.player_data,
.party_data,
.admin_data {
    padding: 20px;
    background: linear-gradient(145deg, rgba(14, 24, 40, 0.78), rgba(8, 14, 26, 0.82));
    backdrop-filter: blur(18px) saturate(140%);
    color: rgba(232, 240, 255, 0.95);
    box-sizing: border-box;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: visible;
}

.player_data,
.party_data {
    box-shadow:
        inset 0 1px 0 rgba(210, 235, 255, 0.18),
        inset 0 -1px 0 rgba(4, 10, 24, 0.5),
        inset 0 0 24px rgba(90, 150, 230, 0.18);
}

.admin_data {
    box-shadow:
        0 18px 40px rgba(4, 10, 24, 0.45),
        inset 0 1px 0 rgba(210, 235, 255, 0.18),
        inset 0 -1px 0 rgba(4, 10, 24, 0.5),
        inset 0 0 24px rgba(90, 150, 230, 0.18);
}

.party {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
    gap: 10px;
}

.creature-button {
    display: flex;
    align-items: center;
    background: linear-gradient(160deg, rgba(18, 30, 52, 0.82), rgba(8, 14, 26, 0.88));
    border-radius: 32px; /* Rounded button */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
    padding: 6px;
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow:
        0 12px 26px rgba(4, 10, 24, 0.35),
        inset 0 1px 0 rgba(210, 235, 255, 0.2),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
    gap: 10px;
}

.creature-button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 32px rgba(4, 10, 24, 0.4),
        inset 0 1px 0 rgba(220, 245, 255, 0.25),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
}

.party-animal-icon {
    margin-right: 0;
    flex: 0 0 auto;
}

.creature-name {
    color: white;
    font-size: 18px;
    flex-grow: 1; /* Make sure the name takes up the remaining space */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.creature-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(220, 235, 255, 0.9);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.creature-level-value {
    font-size: 12px;
}

.creature-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.party-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.party_data.is-disabled {
    background: linear-gradient(160deg, rgba(30, 34, 38, 0.9), rgba(18, 22, 26, 0.92));
    box-shadow:
        0 14px 30px rgba(4, 10, 24, 0.35),
        inset 0 1px 0 rgba(200, 210, 230, 0.12),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
}

.party_data.is-disabled .party-header,
.party_data.is-disabled .creature-name {
    color: #cfcfcf;
}

.party_data.is-disabled .creature-button {
    background: linear-gradient(160deg, rgba(40, 44, 50, 0.9), rgba(20, 24, 30, 0.92));
}

.party_data.is-disabled .animal-icon-composite-fg {
    filter: grayscale(1) brightness(0.78);
}

#toggle-button {
    background: radial-gradient(circle at 30% 30%, rgba(90, 150, 230, 0.35), rgba(8, 14, 26, 0.95));
    color: white;
    border: none;
    border-radius: 50%; /* Make the button round */
    cursor: pointer;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 9px;
    padding-bottom: 9px;
    margin-left: auto; /* Push the button to the far right */
    vertical-align: middle; /* Align with the text */
    box-shadow:
        0 8px 16px rgba(4, 10, 24, 0.4),
        inset 0 1px 0 rgba(210, 235, 255, 0.25),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
}

#toggle-button:hover {
    background: radial-gradient(circle at 30% 30%, rgba(120, 180, 255, 0.45), rgba(10, 18, 32, 0.95));
}

.nunito {
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    display: flex;
    align-items: center; /* Vertically align items in the flex container */
    justify-content: space-between; /* Ensure the button is at the far right */
}

/* Player data section */
.player {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 15px;
    overflow: visible;
}

.bottom-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#player-toggle-button {
    background: radial-gradient(circle at 30% 30%, rgba(90, 150, 230, 0.35), rgba(8, 14, 26, 0.95));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 9px;
    padding-bottom: 9px;
    margin-left: auto;
    vertical-align: middle;
    box-shadow:
        0 8px 16px rgba(4, 10, 24, 0.4),
        inset 0 1px 0 rgba(210, 235, 255, 0.25),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
}

#player-toggle-button:hover {
    background: radial-gradient(circle at 30% 30%, rgba(120, 180, 255, 0.45), rgba(10, 18, 32, 0.95));
}

.player-header,
.party-header {
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(220, 235, 255, 0.9);
}

.player {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.top-row {
    align-items: center;
    gap: 16px;
}

.info {
    display: grid;
    gap: 10px;
    overflow: visible;
}

.info-row--split {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    overflow: visible;
}

.info-cell {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 1 1 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(10, 16, 28, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(210, 235, 255, 0.12),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
    color: rgba(225, 236, 255, 0.92);
}

.info-cell--berry {
    position: relative;
    cursor: default;
}

.berry-hud-panel {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: min(380px, 62vw);
    display: none;
    z-index: 1400;
    pointer-events: none;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(140, 190, 255, 0.4);
    background: linear-gradient(160deg, rgba(14, 24, 42, 0.96), rgba(8, 14, 24, 0.98));
    box-shadow:
        0 12px 28px rgba(4, 10, 24, 0.45),
        inset 0 1px 0 rgba(210, 235, 255, 0.2),
        inset 0 -1px 0 rgba(4, 10, 24, 0.65);
}

.berry-hud-panel-title {
    font-family: "Tomorrow", sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(200, 224, 255, 0.82);
    margin-bottom: 6px;
}

    .berry-hud-panel-row {
    font-size: 12px;
    line-height: 1.4;
    color: rgba(224, 236, 255, 0.95);
}

.berry-hud-panel.is-visible {
    display: grid;
    gap: 6px;
}

.info-label-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.info-label-group--tight {
    gap: 0;
}

.info-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(190, 210, 245, 0.85);
}

.info-value {
    font-size: 13px;
    color: rgba(232, 240, 255, 0.95);
}

.bottom-row {
    gap: 12px;
}

.stat-block {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(10, 16, 28, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(210, 235, 255, 0.12),
        inset 0 -1px 0 rgba(4, 10, 24, 0.6);
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(220, 235, 255, 0.9);
    font-size: 13px;
}

.stat-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stat-values {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: "Michroma", sans-serif;
    color: rgba(220, 235, 255, 0.95);
    text-shadow: 0 2px 6px rgba(4, 10, 24, 0.6);
}

.stat-current {
    font-size: 12px;
    letter-spacing: 0.02em;
}

.stat-sep,
.stat-max {
    font-size: 10px;
    opacity: 0.75;
}

.party-hp {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 22px;
    pointer-events: none;
}

.party-hp-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: rgba(6, 10, 18, 0.7);
    box-shadow: inset 0 0 8px rgba(4, 10, 24, 0.6);
}

.party-hp-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(70, 130, 220, 0.95), rgba(140, 200, 255, 0.95));
    box-shadow: 0 0 8px rgba(120, 180, 255, 0.6);
}

.party-hp-values {
    position: absolute;
    right: 25px;
    bottom: 8px;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: "Michroma", sans-serif;
    color: rgba(220, 235, 255, 0.95);
    text-shadow: 0 2px 6px rgba(4, 10, 24, 0.6);
}

.party-hp-current {
    font-size: 12px;
    letter-spacing: 0.02em;
}

.party-hp-sep,
.party-hp-max {
    font-size: 10px;
    opacity: 0.75;
}

.progress-bar {
    width: 100%;
    background: rgba(6, 10, 18, 0.75);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
    box-shadow: inset 0 0 8px rgba(4, 10, 24, 0.7);
}

.stat-block .progress-bar.energy {
    margin-bottom: 20px;
}

.stat-block .progress-bar.experience {
    margin-bottom: 5px;
}

.progress {
    height: 10px;
    border-radius: 5px;
}

.progress-bar.energy .progress {
    background: linear-gradient(90deg, rgba(70, 130, 220, 0.95), rgba(140, 200, 255, 0.95));
    box-shadow: 0 0 10px rgba(120, 180, 255, 0.5);
}

.progress-bar.experience .progress {
    background: linear-gradient(90deg, rgba(120, 170, 255, 0.85), rgba(200, 230, 255, 0.95));
    box-shadow: 0 0 10px rgba(160, 210, 255, 0.4);
}

.info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.partysprite {
    flex-shrink: 0;
    margin-right: 0;
    transform: scale(2);
}

/* Media query for tablets and smaller devices */
@media (max-width: 1024px) {
    .party {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 10px;
    }

    .player_data,
    .party_data {
        margin-right: 0px;
        margin-bottom: 0;
    }

    .creature-button {
        flex-direction: row; /* Ensure the image and text are in a row */
        width: 95%;
        margin: 0;
        padding: 4px;
        align-items: center;
    }

    .party-hp-values {
        right: 12px;
    }

    .party-animal-icon {
        margin-right: 5px; /* Adjust space between image and text */
        margin-bottom: 0; /* Remove bottom margin */
    }

    .creature-name {
        font-size: 14px;
        margin-top: 0px;
    }
}
