/* ---- Base ---- */

body {
    margin: 0;
    background: #0b0b10;
    color: #e8e8ef;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

#pageLoader {
    position: fixed;
    inset: 0;
    z-index: 200;               /* above the drawer (100) and sound toggle (100) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0b10;
    color: #8a8a9e;
    font-size: 1rem;
    letter-spacing: 0.08em;
}

#pageLoader[hidden],
[hidden] {
    display: none !important;
}

.statbar.is-dead .statbar-toggle {
    display: none !important;
}


/* ---- Auth pages (login / register) ---- */

.auth-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem calc(1.25rem + env(safe-area-inset-right))
             calc(1.5rem + env(safe-area-inset-bottom))
             calc(1.25rem + env(safe-area-inset-left));
    background:
        radial-gradient(900px 500px at 50% -10%, #1e1b3a 0%, transparent 70%),
        #0b0b10;
    color: #e8e8ef;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    width: 100%;
    max-width: 380px;
}

.auth-head {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-mark {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    color: #c9c9ff;
    background: linear-gradient(145deg, #2a2a52, #16162a);
    border: 1px solid #3a3a6a;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(90, 90, 255, 0.18);
}

.auth-head h1 {
    margin: 0 0 0.35rem;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.auth-sub {
    margin: 0;
    color: #8a8a9e;
    font-size: 0.95rem;
}

.auth-form {
    padding: 1.5rem 1.25rem;
    background: rgba(20, 20, 28, 0.85);
    border: 1px solid #2a2a36;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.field { margin-bottom: 1.1rem; }

.field label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8a8a9e;
}

.field input {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 0.8rem 0.9rem;
    background: #101017;
    border: 1px solid #32323d;
    border-radius: 12px;
    color: #e8e8ef;
    /* 16px keeps iOS Safari from zooming in on focus. */
    font-size: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder { color: #4e4e5e; }

.field input:focus {
    outline: none;
    border-color: #5a5aff;
    box-shadow: 0 0 0 3px rgba(90, 90, 255, 0.18);
}

/* Sits under the input, nudged right. Width must stay auto — the
   global `button { width: 100% }` rule would otherwise stretch it. */
.reveal {
    display: block;
    width: auto;
    min-height: 0;
    margin: 0.45rem 0 0 auto;
    padding: 0.25rem 0.1rem;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #6f6f85;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s;
}

.reveal:hover { color: #a8a8ff; background: transparent; }
.reveal:active { color: #c9c9ff; }

.reveal:focus-visible {
    outline: 2px solid #5a5aff;
    outline-offset: 2px;
}

/* The input keeps its own focus ring; hovering the word must not trigger it. */
.field-wrap input:hover { border-color: #32323d; }
.field-wrap input:focus { border-color: #5a5aff; }

.auth-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 0.4rem;
    background: linear-gradient(135deg, #5a5aff, #7b5aff);
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s, opacity 0.15s;
}

.auth-submit:active { transform: scale(0.985); }

.auth-submit:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

.auth-form .error {
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    background: #2a1620;
    border: 1px solid #5c2b3a;
    border-radius: 10px;
    color: #ffb4c0;
    font-size: 0.88rem;
}

.auth-foot {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: #8a8a9e;
}

.auth-foot a {
    color: #a8a8ff;
    font-weight: 600;
    text-decoration: none;
}

.auth-foot a:active { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    .auth-submit, .field input { transition: none; }
}

.card {
    position: relative;
    max-width: 520px;
    margin: 3rem auto;
    padding: 2rem;
    padding-top: 6rem;   /* clears the hamburger in the top-left */
    background: #1b1b22;
    border: 1px solid #32323d;
    border-radius: 10px;
    color: #e8e8ef;
}

.card h1 {
    margin-top: 0;
}

.subtitle {
    color: #9a9ab0;
    margin-bottom: 1.5rem;
}

.card label {
    display: block;
    margin: 1rem 0 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.card input,
.card select,
.card textarea {
    width: 100%;
    padding: 0.6rem;
    background: #121218;
    border: 1px solid #3a3a47;
    border-radius: 6px;
    color: #e8e8ef;
    font: inherit;
    box-sizing: border-box;
}

.card input:focus,
.card select:focus,
.card textarea:focus {
    outline: 2px solid #6c6cff;
    border-color: transparent;
}

.card textarea {
    resize: vertical;
}

.card button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: #5a5aff;
    border: none;
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.card button:hover:not(:disabled) {
    background: #4a4ae0;
}

.card button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error {
    margin-top: 1rem;
    padding: 0.6rem 0.75rem;
    background: #3a1d22;
    border: 1px solid #7a2e38;
    border-radius: 6px;
    color: #ffb3bd;
    font-size: 0.9rem;
}

.muted {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.muted a,
.muted-link {
    color: #9a9aff;
}

.background {
    margin: 1rem 0 1.5rem;
    padding-left: 0.85rem;
    border-left: 3px solid #3a3a47;
    color: #b8b8c8;
    font-style: italic;
}

.stats {
    display: grid;
    /* Forces exactly 5 equal-width columns */
    grid-template-columns: repeat(5, 1fr); 
    gap: 10px;
    width: 100%;
}

/* Force the Health column to span across the entire first row */
.stats .stat-col:first-child {
    grid-column: span 5;
}

/* Ensure the flex column blocks fill 100% of their allocated grid track width */
.stat-col {
    display: flex;
    flex-direction: column;
    width: 100%; 
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Keeps text centered vertically */
    padding: 0.7rem 0.15rem;
    background: #121218;
    border: 1px solid #32323d;
    border-radius: 6px;
    box-sizing: border-box; /* Includes padding & border in the width calculation */
    width: 100%; /* Fills the grid cell perfectly */
    height: 100%; /* Ensures identical height if text wraps */
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #b8b8ff;
    line-height: 1.1;
}

.stat-label {
    margin-top: 0.25rem;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8a9e;
    text-align: center;
}

.progress-panel {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #121218;
    border: 1px solid #32323d;
    border-radius: 8px;
}

.progress-panel h2,
.card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a8a9e;
}

.progress-panel p {
    margin: 0.35rem 0;
}

.moves {
    margin-top: 0.9rem !important;
    font-weight: 600;
    color: #9fe6a0;
}

.moves.spent {
    color: #e6a39f;
}

.pips {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.pip {
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid #5a5aff;
    border-radius: 50%;
}

.pip.filled {
    background: #5a5aff;
}

.inventory {
    margin: 0;
    padding-left: 1.2rem;
    color: #d0d0dd;
}

.inventory .muted-item {
    list-style: none;
    margin-left: -1.2rem;
    color: #70707f;
    font-style: italic;
}

/* ---- Statbar ---- */

.statbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    padding: 0.6rem 1.2rem;
    background: #121218;
    border-bottom: 1px solid #32323d;
    font-size: 0.85rem;
    color: #d0d0dd;
}

.statbar[hidden] { display: none; }

.statbar-name {
    font-weight: 700;
    color: #b8b8ff;
}

.statbar-identity {
    margin-right: auto;
    opacity: 0.75;
    font-size: 0.9em;
    text-transform: uppercase;
}

.statbar-item {
    white-space: nowrap;
}

.statbar-item em {
    font-style: normal;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a8a9e;
    margin-right: 0.25rem;
}

.statbar-day {
    padding-left: 1rem;
    border-left: 1px solid #32323d;
}

.statbar-toggle {
    min-width: 6.4rem;
    text-align: center;
    background: #1e1e28;
    border: 1px solid #32323d;
    color: #b8b8ff;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}


.statbar-toggle:hover {
    background: #282836;
    border-color: #4a4a5a;
}

.statbar-extra {
    order: 2;
    flex-basis: 100%;
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 0.32s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.25s ease,
                margin-top 0.32s ease;
}

.statbar-extra-inner {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    padding-top: 0.6rem;
    border-top: 1px solid #22222a;
    transform: translateY(0);
    transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1),
                padding-top 0.32s ease,
                border-color 0.2s ease;
}

.statbar.is-collapsed .statbar-extra {
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: -0.6rem; /* Cancels the flex row gap when collapsed */
    pointer-events: none;
}

.statbar.is-collapsed .statbar-extra-inner {
    transform: translateY(-6px);
    padding-top: 0;
    border-color: transparent;
}

/* Statuses & Inventory inside the animated container */
.statbar-statuses,
.statbar-inventory {
    flex-basis: 100%;
    white-space: normal;
    line-height: 1.4;
}

/* --- MOBILE OPTIMIZATION (Screens smaller than 600px) --- */
@media (max-width: 600px) {
    /* Tightens the space below the menu button inside the main card */
    .card {
        padding-top: 4rem;
    }

    .statbar {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: start;
        gap: 0.8rem 0.4rem;
        padding: 0.8rem 1rem;
    }

    .statbar > * {
        min-width: 0;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Row 1: Name & Identity */
    .statbar-name {
        grid-column: 1 / -1;
        margin-right: 0;
        padding-top: 3rem !important;
    }

    .statbar-identity {
        grid-column: 1 / -1;
        margin-right: 0;
        border-bottom: 1px solid #22222a;
        padding-bottom: 0.4rem;
    }

    /* Row 2: HP */
    .statbar-identity + .statbar-item {
        grid-column: 1 / -1;
        font-weight: bold;
        border-bottom: 1px solid #22222a;
        padding-bottom: 0.5rem;
        text-transform: uppercase;
    }

    /* Row 3: STR, WIS, CHA, STL, MAG automatically occupy the 5 columns */

    /* Row 4: Animated Collapsible Wrapper */
    .statbar-extra {
        order: 0;
        grid-column: 1 / -1;
        flex-basis: initial;
        width: 100%;
    }

    /* Reset desktop's -0.6rem top margin and cancel out mobile's 0.8rem grid gap */
    .statbar.is-collapsed .statbar-extra {
        margin-top: 0;
        margin-bottom: -0.8rem;
    }

    .statbar-extra-inner {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.8rem 0.4rem;
        width: 100%;
    }

    .statbar-statuses,
    .statbar-inventory {
        grid-column: 1 / -1;
        flex-basis: initial;
    }

    /* Time Tracking inside the inner grid */
    .statbar-day,
    .statbar-day ~ .statbar-item {
        padding-left: 0;
        border-left: none;
        white-space: nowrap;
    }

    .statbar-day { grid-column: span 1; }
    .statbar-day + .statbar-item { grid-column: span 1; text-align: left; }
    .statbar-day + .statbar-item + .statbar-item { grid-column: span 3; text-align: right; }

    /* Row 5: Toggle Button */
    .statbar-toggle {
        grid-column: 1 / -1;
        min-width: 0;
        width: 100%;
        text-align: center;
        margin-left: 0;
        padding: 0.4rem;
    }
}

.prompt {
    margin: 1.5rem 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.choice {
    width: 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    background: #121218;
    border: 1px solid #3a3a47;
    border-radius: 6px;
    color: #e8e8ef;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.choice:hover:not(:disabled) {
    border-color: #5a5aff;
    background: #16161f;
}

.choice:disabled {
    opacity: 0.45;
    cursor: default;
}

.choice.chosen {
    opacity: 1;
    border-color: #5a5aff;
    background: #1d1d2e;
}

.choice-key {
    display: inline-block;
    width: 1.5rem;
    font-weight: 700;
    color: #8a8aff;
}

.feedback {
    margin-top: 1.25rem;
    padding: 0.7rem 0.9rem;
    background: #16221a;
    border: 1px solid #2f5438;
    border-radius: 6px;
    color: #9fe6a0;
    font-size: 0.9rem;
}

.card button.secondary {
    margin-top: 0.6rem;
    background: transparent;
    border: 1px solid #5a5aff;
    color: #b8b8ff;
}

.card button.secondary:hover {
    background: #1d1d2e;
}

.day-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 1.5rem;
}

.day-chip {
    width: auto !important;
    margin: 0 !important;
    padding: 0.35rem 0.75rem !important;
    background: #121218;
    border: 1px solid #3a3a47;
    border-radius: 999px;
    color: #b0b0c0;
    font-size: 0.8rem;
    cursor: pointer;
}

.day-chip.active {
    border-color: #5a5aff;
    background: #1d1d2e;
    color: #c8c8ff;
}

.timeline {
    margin: 0;
    padding-left: 1.25rem;
}

.timeline-item {
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.timeline-prompt {
    margin: 0 0 0.5rem;
    color: #b8b8c8;
    line-height: 1.5;
}

.timeline-choice {
    margin: 0;
    padding: 0.6rem 0.8rem;
    background: #1d1d2e;
    border-left: 3px solid #5a5aff;
    border-radius: 4px;
    color: #e8e8ef;
}

.timeline-effects {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: #9fe6a0;
}

.class-preview {
    margin: 0.6rem 0 0;
    padding: 0.6rem 0.8rem;
    background: #121218;
    border: 1px solid #32323d;
    border-radius: 6px;
    color: #b8b8ff;
    font-size: 0.85rem;
}

.prompt {
    white-space: pre-wrap;
  }

#sound-toggle:hover,
#sound-toggle:focus-visible {
    opacity: 1;
}

#charName,
#barName,
#charRace,
#charClass {
    text-transform: uppercase;
}

.statbar-statuses {
    opacity: 1;
}

.spendBtn {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    line-height: 1;
    border-radius: 50%;
}

.spendBtn {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1rem;
}

.spendBtn[hidden] {
    display: none;
}

.status-list {
    text-align: left;
    margin: 1.5rem 0;
}

.status-list dt {
    font-weight: 700;
    margin-top: 1rem;
}

.status-list dd {
    margin: 0.25rem 0 0;
}

.menu-btn {
    position: absolute;
    top: 1rem;
    left: 2rem;
    width: 42px !important;   /* beats .card button { width: 100% } */
    height: 42px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
}
.menu-btn:hover { background: rgba(255, 255, 255, 0.06); border-radius: 8px; }

.menu-btn span {
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 90;
}
.menu-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: min(300px, 85vw);
    box-sizing: border-box;
    background: #1b1b22;
    border-right: 1px solid #32323d;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
    padding: 3.5rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 100;
}

.side-menu.open {
    transform: translateX(0);
}

.side-menu hr {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 0.5rem 0;
}

.menu-title {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8a8a9e;
}

/* Match the card's button styling inside the drawer */
.side-menu button {
    width: 100%;
    margin: 0;
    padding: 0.75rem;
    background: #5a5aff;
    border: none;
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.side-menu button:hover:not(:disabled) {
    background: #4a4ae0;
}

.side-menu button.secondary {
    background: transparent;
    border: 1px solid #5a5aff;
    color: #b8b8ff;
}

.side-menu button.secondary:hover {
    background: #1d1d2e;
}

.status-danger {
    color: #ffb3bd;
    font-weight: 600;
    font-weight: bold;
    font-style: italic;
}

.critical-status-alert {
    margin: 0.85rem 0 1rem;
    padding: 0.55rem 0.8rem;
    background: #3a1d22;
    border: 1px solid #7a2e38;
    border-radius: 6px;
    color: #ffb3bd;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Destructive actions get a red accent */
.side-menu button.danger,
.card button.danger {
    background: transparent; /* or match your .secondary button background */
    border: 1px solid #7a2e38;
    color: #ffb3bd;
}

.card button.danger:hover:not(:disabled) {
    background: rgba(122, 46, 56, 0.25);
    border-color: #9e3b48;
}

.side-menu button.danger:hover {
    background: #2a161c;
}

/* Keep the × small — exempt it from the full-width button rule */
.side-menu .menu-close {
    width: auto;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    color: #8a8a9e;
    font-size: 1.5rem;
    line-height: 1;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.side-menu .menu-close:hover {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #e8e8ef;
}

#jumpLatestBtn {
    margin-bottom: 1.5rem;
}

#finishedText {
    white-space: pre-line;
}

@media (max-width: 600px) {
    :root { --edge: 2rem; }   /* the left edge for header and content text */

    .menu-btn {
        position: absolute;
        top: 0;
        left: calc(var(--edge) - 10px);   /* the bars are 22px wide in a 42px button, so shift 10px to line them up with the text */
        background: transparent;
        border-radius: 8px;
        z-index: 80;
    }

    /* The strip is the bar's own top padding, so it's the same color as the bar */
    .statbar {
        padding: calc(42px + 0.5rem) var(--edge) 0.8rem;
    }

    .card {
        position: static;
        margin-top: 4rem;      /* clears the hamburger on pages with no statbar */
        padding-top: 2rem;
    }

    /* With the statbar showing, the card sits right under it */
    body:has(.statbar:not([hidden])) .card {
        margin-top: 1rem;
    }
}

/* ---- Audio Controls ---- */

.audio-controls {
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    margin: .5rem auto 3rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #1b1b22;
    border: 1px solid #32323d;
    border-radius: 10px;
    color: #e8e8ef;
}

#sound-toggle {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #121218;
    border: 1px solid #32323d;
    border-radius: 8px;
    color: #c9c9ff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#sound-toggle:hover {
    background: rgba(90, 90, 255, 0.18);
    border-color: #5a5aff;
    color: #fff;
}

#sound-toggle[aria-pressed="true"] {
    color: #6f6f85;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    width: 100%;
    height: 8px;
    background: #121218;
    border: 1px solid #32323d;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    touch-action: pan-y; /* Prevents accidental page drag while sliding */
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #5a5aff;
    border: 2px solid #e8e8ef;
    cursor: pointer;
    transition: transform 0.12s, background 0.15s;
}

#volume-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #5a5aff;
    border: 2px solid #e8e8ef;
    cursor: pointer;
    transition: transform 0.12s, background 0.15s;
}

#volume-slider:hover::-webkit-slider-thumb,
#volume-slider:hover::-moz-range-thumb {
    background: #7b5aff;
    transform: scale(1.15);
}

/* ---- Speaker Icon States ---- */

.speaker-icon {
    display: block;
}

/* Hide the mute 'X' when unmuted */
#sound-toggle .mute-slash {
    display: none;
}

/* Hide outer wave when volume is below 50% */
#sound-toggle[data-low="true"] .wave-outer {
    display: none;
}

/* When muted: hide all sound waves and show the 'X' */
#sound-toggle[aria-pressed="true"] .wave-inner,
#sound-toggle[aria-pressed="true"] .wave-outer {
    display: none;
}

#sound-toggle[aria-pressed="true"] .mute-slash {
    display: block;
    stroke: #e6a39f; /* Matches your .moves.spent muted red accent */
}
