#volume-control-container {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.mute-button {
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    color: white;
    transition: background-color 0.3s ease;
    z-index: 1001;
}

.mute-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

#volume-slider-container {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 18px;
    padding: 8px 18px;
    margin-left: 12px;
    width: 180px;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#volume-control-container:hover #volume-slider-container,
#volume-slider-container.show-for-mobile {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

#volume-slider {
    -webkit-appearance: none;
    width: 120px;
    height: 8px;
    border-radius: 8px;
    background: #d3d3d3;
    outline: none;
    margin-right: 12px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

#volume-level {
    color: white;
    font-size: 16px;
    width: 40px;
    text-align: right;
}

/* Media query for mobile devices - make controls even larger */
@media (max-width: 768px) {
    .mute-button {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    #volume-slider-container {
        position: absolute;
        left: 70px;
        top: 5px;
        width: 200px;
        padding: 10px 20px;
        border-radius: 20px;
    }

    #volume-slider {
        width: 140px;
        height: 10px;
    }

    #volume-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    #volume-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    #volume-level {
        font-size: 18px;
        width: 45px;
    }
}

/* For small screens, adjust positioning */
@media (max-width: 480px) {
    #volume-control-container {
        top: 10px;
        left: 10px;
    }

    #volume-slider-container {
        left: 65px;
    }
}


/* Shop drawer styling (shared by both shops) */
.shop-drawer {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    cursor: default;
    position: fixed;
    left: 0;
    bottom: -100vh;
    width: 100vw;
    max-width: 100vw;
    background: rgba(0,0,0,0.85);
    box-shadow: 0 -2px 16px #111;
    border-radius: 30px 30px 0 0;
    z-index: 1001;
    padding: 20px 0 300px 0;
    display: flex;
    scroll-padding-bottom: 120px;
    justify-content: center;
    transition: bottom 0.35s cubic-bezier(.7,1.7,.6,.9);
}

/* Override shop-drawer styles for leaderboard */
#leaderboardDrawer {
    max-height: none; /* Remove max-height constraint */
    height: 100vh; /* Full viewport height */
    position: fixed;
    right: -600px;
    left: auto;
    width: 600px;
    top: 0;
    bottom: auto; /* Override bottom position */
    background: rgba(0, 0, 0, 0.95);
    transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px 0 0 0;
    display: flex;
    flex-direction: column;
    color: white;
    padding: 20px 0;
}

@font-face {
    font-family: 'LoveLikeThis';
    src: url('font.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    background-image: url('bg.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: url('fist2.png') 40 60, auto;
    font-family: 'LoveLikeThis', sans-serif;
    overflow-x: hidden;
}

#counter {
    font-weight: 400;
    color: white;
    font-style: normal;
    font-size: 7.5em;
    margin-bottom: 20px;
    text-align: center;
    -webkit-text-stroke-width: 5px;
    -webkit-text-stroke-color: black;
    paint-order: stroke fill;
}

#ella-img {
    position: relative;
    width: 400px;
    height: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    user-select: none;
    transition: transform 0.1s ease;
    padding: 20px;
    box-sizing: content-box;
    -webkit-user-drag: none;
}

.squish {
    transform: scale(1.2, 0.8);
}

.click-effect {
    position: fixed;
    width: 50px;
    height: 50px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
    user-select: none;
    transform: translate(-50%, -50%);
}

/* Container for the two shop buttons side by side */
#shop-buttons-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1002;
}

/* Shop toggle buttons */
.shop-drawer-toggle {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 20px 15px;
    font-size: 2em;
    font-family: 'LoveLikeThis', sans-serif;
    cursor: pointer;
    box-shadow: 0 0 8px #222;
    transition: background 0.2s;
    flex: 1;
    max-width: 150px;
    text-align: center;
}

.shop-drawer-toggle.open {
    background: #555;
}

#leaderboardDrawer {
    max-height: none;
    height: 100vh;
    position: fixed;
    right: -700px;
    z-index: 1020;
    left: auto;
    width: 600px;
    top: 0;
    bottom: auto;
    background: rgba(0, 0, 0, 0.95);
    transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px 0 0 10px; /* Add bottom left corner radius */
    display: flex;
    flex-direction: column;
    color: white;
    padding: 20px 100px 0 0;
}

/* Sticky header for leaderboard */
#leaderboard-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(50, 0, 80, 0.95);
    border-bottom: 2px solid rgba(138, 43, 226, 0.7);
    font-size: 1.3em;
    font-weight: bold;
    z-index: 10;
    min-width: 500px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

#leaderboard-header .leaderboard-section {
    display: flex;
    align-items: center;
}

#leaderboard-header .rank-name {
    flex: 1;
    margin-right: 80px;
}

.score-header {
    width: 100px;
    color: #b6b6b6;
    text-align: right;
}

.prestige-header {
    width: 100px;
    color: #ffeb3b;
    text-align: right;
}

/* Adjust the leaderboard content to make room for the header */
.leaderboard-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 30px;
}

.leaderboard-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 30px;
}

/* Update leaderboard item styles to match the header */
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2em;
    min-width: 500px;
}

.leaderboard-section {
    display: flex;
    align-items: center;
}

.rank-name {
    flex: 1;
}

.score {
    width: 100px; /* Match the header width */
    color: #ffeb3b;
    text-align: right;
}

.prestige {
    width: 100px; /* Match the header width */
    color: #ffeb3b;
    text-align: right;
}

/* Add this to your JavaScript event listeners */
#leaderboardDrawer.open {
    right: -100px; /* Slide in from the right */
}

#leaderboardToggleBtn {
    position: fixed;
    right: 0;
    top: 140px;
    transform: rotate(-90deg);
    transform-origin: bottom right;
    border-radius: 10px 10px 0 0;
    padding: 15px 30px;
    transition: right 0.3s ease;
    font-size: 1.8em;
    min-width: 120px;
}

#leaderboardToggleBtn.open {
    right: 600px; /* Move with the drawer */
}

.button-icon {
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

#leaderboardToggleBtn.open .button-icon {
    transform: rotate(90deg); /* Keep the icon rotated the same way */
}
/* Adjust the content padding */


.leaderboard-content h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    text-align: center;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2em;
    min-width: 500px;
}

.leaderboard-section {
    display: flex;
    align-items: center;
}

.rank-name {
    flex: 1;
}

.score {
    text-align: right;
    color: #ffeb3b;
}

.prestige {
    color: #ffeb3b;
}

#leaderboardDrawer {
    min-width: 600px;  /* Ensure drawer is wide enough */
}

.hidden {
    display: none;
}

/* Style for the username input container */
#username-input {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 0 20px;
}

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 80px;
}

/* Style for the username text input */
#player-name {
    background: rgba(75, 0, 130, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.7);
    box-shadow: 0 0 10px 2px rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    padding: 12px 15px;
    color: white;
    font-family: 'LoveLikeThis', sans-serif;
    font-size: 1.2em;
    width: 60%;
    outline: none;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

#player-name:focus {
    background: rgba(75, 0, 130, 0.8);
    box-shadow: 0 0 15px 3px rgba(138, 43, 226, 0.8);
}

#player-name::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Style for the save username button */
#save-username {
    background-color: #9b59b6;
    box-shadow: 0 0 8px #8e44ad;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-family: 'LoveLikeThis', sans-serif;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#save-username:hover {
    background-color: #8e44ad;
    box-shadow: 0 0 12px #7d3c98;
}

/* Add a class for the "edit name" button at the top of leaderboard */
.edit-name-btn {
    background-color: #9b59b6;
    box-shadow: 0 0 8px #8e44ad;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: white;
    font-family: 'LoveLikeThis', sans-serif;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 0 auto 20px auto;
    display: block;
}

.edit-name-btn:hover {
    background-color: #8e44ad;
}

/* Highlight the current user's entry */
.leaderboard-item.current-user {
    background: rgba(75, 0, 130, 0.4);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.4);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.leaderboard-item.current-user:hover {
    background: rgba(75, 0, 130, 0.6);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
}
/* Username change button for users already on the leaderboard */
.change-name-btn {
    background-color: #9b59b6;
    box-shadow: 0 0 8px #8e44ad;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    color: white;
    font-family: 'LoveLikeThis', sans-serif;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 10px;
}

.change-name-btn:hover {
    background-color: #8e44ad;
}
.shop-drawer.open {
    bottom: -100px;
}

/* Shop container */
.shop {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    width: 120vw;
    max-width: 1000px;
    padding-bottom: 300px;
}

/* Individual shop items */
.shop-item {
    cursor: pointer;
    background: rgba(75, 0, 130, 0.8);
    box-shadow: 0 0 10px 2px rgba(138, 43, 226, 0.7);
    border-radius: 10px;
    padding: 20px;
    width: 180px;
    text-align: center;
    color: white;
    filter: none;
    transition: filter 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'LoveLikeThis', sans-serif;
    position: relative;
}
.shop-item p {
    font-size: 1.3em; /* increase as desired */
    margin: 5px 0;
}

.shop-item.disabled {
    background: rgba(0, 0, 0, 0.5);
    box-shadow: none;
    filter: grayscale(100%);
    opacity: 0.6;
    pointer-events: none; /* This prevents clicks on disabled items */
}

.shop-item img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 10px;
    user-select: none;
    pointer-events: none;
}

.shop-item h3 {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: black;
    paint-order: stroke fill;
    font-family: 'LoveLikeThis', sans-serif;
}

.shop-item button, .reset-pos-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    background-color: #9b59b6 !important;
    box-shadow: 0 0 8px #8e44ad;
    color: white;
    font-family: 'LoveLikeThis', sans-serif;
    font-weight: 700;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
}
.shop-drawer-toggle:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.shop-item button:hover:not(:disabled) {
    background-color: #8e44ad;
}

.shop-item.disabled button {
    background: #666;
    cursor: not-allowed;
    box-shadow: none;
}

/* Info button styling */
.info-btn {
    margin-top: 12px;
    background: transparent;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #f1c40f;
    user-select: none;
    transition: color 0.3s ease;
    pointer-events: auto !important;
    font-family: 'LoveLikeThis', sans-serif;
}

.info-btn:hover, .reset-pos-btn:hover {
    color: #f39c12;
}

/* Notification container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 30px;
}
.leaderboard-section {
    display: flex;
    justify-content: space-between;
}

.current-score {

    color: #4CAF50; /* Green color to differentiate from highest score */
}

.scores {
    display: flex;
    align-items: center;
}

.high-score {
    width: 100px;
    text-align: right;
    color: #4CAF50FF;
}

/* Notification style */
.notification {
    background: rgba(75, 0, 130, 0.8);
    box-shadow: 0 0 10px 2px rgba(138, 43, 226, 0.7);
    border-radius: 10px;
    padding: 20px;
    color: white;
    font-family: 'LoveLikeThis', sans-serif;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Keep existing animation/position properties */
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    z-index: 3000;
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s forwards, fadeOut 0.5s forwards 4.5s;
}
.progress-container {
    width: 40%;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin: 15px auto;
    padding: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 7px;
    background: linear-gradient(to right, #4776E6, #8E54E9);
    transition: width 0.5s ease-out;
    box-shadow: 0 0 10px rgba(142, 84, 233, 0.5);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(0, 0, 0, 0.05) 51%,
            rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: 7px;
}

/* Info modal backdrop */
.info-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000; /* above shops and notifications */
}

.info-modal {
    cursor: pointer;
    background: rgba(75, 0, 130, 0.8);
    box-shadow: 0 0 10px 2px rgba(138, 43, 226, 0.7);
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    max-width: 90%;
    color: white;
    filter: none;
    transition: filter 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'LoveLikeThis', sans-serif;
    position: relative;
    font-size: 1.2em;
}

.info-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: white;
    user-select: none;
}

.info-modal p {
    margin: 10px 0 0 0;
    user-select: text;
}


/* Modal text alignment */
.info-modal p {
    text-align: center;
    margin: 15px 0;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #ella-img {
        width: 260px;
        height: 260px;
    }
    .shop-item img {
        width: 80px;
        height: 80px;
    }
    .shop-item {
        width: 140px;
        font-size: 1.1em;
        padding: 15px;
    }
    #counter {
        font-size: 5.5em;
    }
    .shop-drawer-toggle {
        font-size: 1.8em;
        padding: 15px 15px;
    }
    .info-btn {
        font-size: 1.5em;
    }
}

/* Add this new class */
.hire-character-draggable {
    z-index: 1100; /* above shop drawers */
    box-shadow: 0 0 20px 5px rgba(138, 43, 226, 0.7);
    transition: box-shadow 0.3s ease;
}


/* Modify existing .hire-character */
.hire-character {
    position: fixed;
    width: 150px;
    cursor: grab;
    z-index: 900; /* lower than shop drawers */
    border-radius: 10px;
    box-shadow: none;
    user-select: none;
    -webkit-user-drag: none;
}


.hire-character:active {
    cursor: grabbing;
}
/* Responsive styles for mobile */
@media (max-width: 600px) {
    /* Leaderboard drawer positioning */
    #leaderboardDrawer {
        width: 80%;
        right: -100vw;
        padding: 20px 10px;
        min-width: unset;
    }

    #leaderboardDrawer.open {
        right: 0;
    }

    #leaderboardToggleBtn {
        font-size: 1.2em;
        min-width: 80px;
        padding: 10px 20px;
        top: 50px;
        right: 0;
        transform-origin: right bottom;
    }

    #leaderboardToggleBtn.open {
        right: 83%;
    }

    /* Layout for leaderboard content */
    .leaderboard-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        overflow-y: auto; /* Explicit scroll for content */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        box-sizing: border-box;
        padding: 10px;
    }

    #leaderboard-list {
        padding-bottom: 150px;
    }



    .leaderboard-content h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    #leaderboard-header .rank-name  {
        margin-right: 0;
    }
    /* Header and item styling */
    #leaderboard-header, .leaderboard-item {

        min-width: unset;
        width: 100%;
        box-sizing: border-box;
        font-size: 0.9em;
        padding: 10px;
        margin-right: 10px;
        display: grid;
        grid-template-columns: 15fr 1fr 0.8fr;
        justify-content: end;
        overflow: hidden;
    }

    /* Text content formatting */
    .rank-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-right: 5px;
    }

    .score, .score-header, .high-score {
        width: 70px;
        text-align: right;
        padding-right: 10px;
    }

    .prestige, .prestige-header {
        width: 60px;
        text-align: right;
    }

    /* Username input area */
    #username-input {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
        width: 100%;
        box-sizing: border-box;
    }

    #username-input input {
        width: 100%;
        padding: 8px;
        font-size: 16px;
        box-sizing: border-box;
    }

    #username-input button {
        width: 100%;
        padding: 8px;
        font-size: 1em;
    }

    /* Button icon */
    .button-icon {
        transform: rotate(90deg);
        display: inline-block;
    }
}
/* Gold gradient for prestige header and values */
.prestige-header,
.prestige {
    background-image: linear-gradient(to right, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

/* Silver gradient for highest score header and values */
.score-header:nth-child(2),
.high-score {
    background-image: linear-gradient(to right, #757F9A, #D7DDE8, #9FA4A9, #CBCED4, #757F9A);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

/* Light blue gradient for current score header and values */
.score-header:nth-child(1),
.current-score {
    background-image: linear-gradient(to right, #56CCF2,  #b8ebff, #56CCF2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}
.leaderboard-item:hover {
    background: rgba(224, 0, 227, 0.2);
    border-radius: 8px;
}
/* Add slight shine effect on hover */
.leaderboard-item:hover .current-score,
.leaderboard-item:hover .high-score,
.leaderboard-item:hover .prestige ,
.leaderboard-item:hover .rank-name {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}
