.title-settings-btn,
.game-settings-btn,
.soundtrack-open-btn {
    position: absolute;
    z-index: 5;
    padding: 11px 16px;
    color: #fff4c7;
    border: 1px solid rgba(255, 233, 151, 0.54);
    border-radius: 999px;
    background: rgba(9, 46, 45, 0.66);
    box-shadow: 0 12px 26px rgba(2, 19, 25, 0.34);
    backdrop-filter: blur(5px);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.title-settings-btn {
    right: clamp(18px, 4vw, 48px);
    top: 28px;
}

.game-settings-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
}

.soundtrack-open-btn {
    right: 28px;
    bottom: 24px;
}

.title-settings-btn:hover,
.game-settings-btn:hover,
.soundtrack-open-btn:hover {
    background: rgba(18, 73, 61, 0.82);
    box-shadow: 0 15px 30px rgba(2, 19, 25, 0.42);
    transform: translateY(-1px);
}

#start-screen .start-container .adventure-test-btn {
    right: 20px;
    bottom: 18px;
    padding: 8px 14px;
    font-size: 0.86rem;
}

.audio-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 36px);
    background: rgba(6, 13, 26, 0.62);
}

.audio-overlay.hidden {
    display: none;
}

.audio-modal {
    width: min(760px, 94vw);
    max-height: min(720px, 92vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #10201d;
    border: 1px solid rgba(255, 236, 160, 0.42);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(252, 250, 229, 0.98), rgba(232, 244, 226, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.settings-modal {
    width: min(520px, 94vw);
}

.audio-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    color: #fff6d2;
    border-bottom: 1px solid rgba(255, 236, 160, 0.26);
    background:
        linear-gradient(180deg, rgba(18, 73, 61, 0.96), rgba(7, 38, 43, 0.96));
}

.audio-modal-eyebrow {
    margin: 0 0 3px;
    color: rgba(255, 232, 152, 0.76);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.audio-modal-header h2 {
    margin: 0;
    font-size: 1.45rem;
}

.audio-close-btn {
    width: 40px;
    height: 40px;
    color: #fff6d2;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 1.45rem;
    line-height: 1;
}

.audio-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.soundtrack-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 18px;
    min-height: 360px;
    padding: 20px;
    overflow: hidden;
}

.soundtrack-track-list {
    min-height: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 10px;
    padding-right: 4px;
}

.soundtrack-track-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    color: #10201d;
    border: 1px solid rgba(16, 64, 55, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-align: left;
    font-weight: 800;
}

.soundtrack-track-btn:hover,
.soundtrack-track-btn.is-active {
    border-color: rgba(184, 126, 26, 0.42);
    background: rgba(255, 244, 194, 0.82);
}

.soundtrack-track-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soundtrack-track-play-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 236, 160, 0.48);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 242, 168, 0.22), rgba(18, 73, 61, 0.16)),
        rgba(18, 73, 61, 0.86);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.20),
        0 4px 10px rgba(2, 19, 25, 0.16);
}

.soundtrack-track-play-icon::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 2px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid #fff6d2;
}

.soundtrack-track-btn.is-playing .soundtrack-track-play-icon::before {
    width: 4px;
    height: 12px;
    margin-left: 0;
    border-top: 0;
    border-bottom: 0;
    border-left: 3px solid #fff6d2;
    border-right: 3px solid #fff6d2;
}

.soundtrack-empty {
    margin: 0;
    color: #4b5563;
    font-weight: 700;
}

.soundtrack-player {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(16, 64, 55, 0.14);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(18, 73, 61, 0.10), rgba(255, 255, 255, 0.38));
}

.soundtrack-current-track {
    margin: 0;
    color: #10201d;
    font-weight: 900;
    line-height: 1.45;
}

.soundtrack-player-actions {
    display: grid;
    gap: 10px;
}

.audio-action-btn {
    padding: 11px 14px;
    color: #2d1b04;
    border: 1px solid rgba(255, 249, 184, 0.88);
    border-radius: 999px;
    background: linear-gradient(180deg, #fff2a8, #e6b241 50%, #9b6419);
    cursor: pointer;
    font-weight: 900;
}

.audio-action-btn.secondary {
    color: #fff6d2;
    border-color: rgba(255, 236, 160, 0.34);
    background: rgba(18, 73, 61, 0.86);
}

.audio-action-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.settings-body {
    padding: 22px;
}

.volume-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    color: #10201d;
    font-weight: 900;
}

.volume-range {
    width: 100%;
    accent-color: #d99a26;
}

.settings-note {
    margin: 14px 0 0;
    color: #38514b;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .title-settings-btn {
        right: 16px;
        top: 16px;
    }

    .soundtrack-open-btn {
        right: 16px;
        bottom: 16px;
    }

    .soundtrack-body {
        grid-template-columns: 1fr;
        max-height: 72vh;
        overflow: auto;
    }

    .soundtrack-track-list {
        overflow: visible;
    }
}
