html, body {
    overflow: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: black;
}
#renderCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    display: block;
}

.carousel-animation-hub {
    width: 320px;
    height: 100%;
    box-sizing: border-box;
    padding: 14px 12px 14px 14px;
    color: #f4f4f4;
    background: rgba(0, 0, 0, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    backdrop-filter: blur(6px);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.carousel-animation-hub.is-compact {
    width: 240px;
}

.carousel-animation-hub__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.carousel-animation-hub__title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.carousel-animation-hub__count {
    width: fit-content;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.10);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
}

.carousel-animation-hub__character-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.carousel-animation-hub__character-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    color: #f4f4f4;
    background: rgba(255, 255, 255, 0.12);
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.carousel-animation-hub__character-button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.carousel-animation-hub__character-label {
    min-width: 48px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(0, 0, 0, 0.24);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.carousel-animation-hub.is-compact .carousel-animation-hub__header {
    flex-direction: column;
    align-items: stretch;
}

.carousel-animation-hub.is-compact .carousel-animation-hub__character-controls {
    justify-content: space-between;
}

.carousel-animation-hub__title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.98;
}


.carousel-animation-hub__source-nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-animation-hub__source-nav.is-disabled {
    opacity: 0.72;
}

.carousel-animation-hub__source-nav-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    color: #f4f4f4;
    background: rgba(255, 255, 255, 0.12);
    font-size: 29px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.carousel-animation-hub__source-nav-button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.carousel-animation-hub__source-nav-button:disabled {
    opacity: 0.48;
    cursor: default;
}

.carousel-animation-hub__source-nav-label {
    min-width: 0;
    flex: 1 1 auto;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.94);
    background: rgba(255, 255, 255, 0.08);
    font-size: 16px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-animation-hub__status {
    width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto;
    min-height: 22px;
    padding: 2px 0;
    font-size: 14px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.78);
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.carousel-animation-hub__list {
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.carousel-animation-hub__item {
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: #f2f2f2;
    background: rgba(255, 255, 255, 0.08);
    font-size: 15px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.carousel-animation-hub.is-compact .carousel-animation-hub__item {
    min-height: 30px;
    padding: 7px 10px;
    font-size: 14px;
}

.carousel-animation-hub__item:hover {
    background: rgba(255, 255, 255, 0.16);
}

.carousel-animation-hub__item.is-active {
    border-color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.24);
    font-weight: 800;
}

.carousel-animation-hub__empty {
    padding: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.4;
}


.carousel-animation-hub__debug {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.carousel-animation-hub__debug-summary {
    padding: 7px 9px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    user-select: none;
}

.carousel-animation-hub__debug-body {
    box-sizing: border-box;
    min-height: 225px;
    max-height: 1100px;
    margin: 0;
    padding: 8px 9px;
    overflow: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(215, 235, 255, 0.86);
    background: rgba(0, 0, 0, 0.26);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}
.carousel-animation-hub.is-legacy-positioned {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
}

.carousel-animation-hub__filter {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
}

.carousel-animation-hub__filter-button {
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.carousel-animation-hub__filter-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.carousel-animation-hub__filter-button.is-active {
    border-color: rgba(255, 255, 255, 0.58);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.24);
}

.carousel-animation-hub__favorites-meta {
    margin-left: auto;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(0, 0, 0, 0.22);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.carousel-animation-hub__row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.carousel-animation-hub__favorite-button {
    width: 36px;
    min-height: 34px;
    flex: 0 0 36px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.08);
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.carousel-animation-hub__favorite-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.carousel-animation-hub__favorite-button.is-favorite {
    border-color: rgba(255, 255, 255, 0.52);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
}

.carousel-animation-hub__row.is-active .carousel-animation-hub__item {
    border-color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.24);
    font-weight: 800;
}

.carousel-animation-hub__row .carousel-animation-hub__item {
    flex: 1 1 auto;
    min-width: 0;
}

.carousel-animation-hub.is-compact .carousel-animation-hub__favorite-button {
    width: 32px;
    min-height: 30px;
    flex-basis: 32px;
    font-size: 17px;
}

/* ── Character Switcher (bottom-center floating widget) ─────────────────── */

.carousel-character-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    color: #f4f4f4;
    background: rgba(0, 0, 0, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    pointer-events: auto;
}

/* Fallback positioning when HudHost is not available */
.carousel-character-switcher--fixed {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
}

.carousel-character-switcher__button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    color: #f4f4f4;
    background: rgba(255, 255, 255, 0.12);
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.carousel-character-switcher__button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.carousel-character-switcher__label {
    min-width: 48px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(0, 0, 0, 0.24);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.carousel-animation-hub__source-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 7px 0 2px;
}

.carousel-animation-hub__source-section + .carousel-animation-hub__source-section {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.carousel-animation-hub__source-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 2px 1px;
    color: rgba(255, 255, 255, 0.82);
}

.carousel-animation-hub__source-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.carousel-animation-hub__source-count {
    flex: 0 0 auto;
    min-width: 20px;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
}



.carousel-animation-hub__speed {
    flex: 0 0 auto;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.carousel-animation-hub__speed-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.carousel-animation-hub__speed-label {
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.carousel-animation-hub__speed-value {
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.24);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.carousel-animation-hub__speed-slider {
    width: 100%;
    box-sizing: border-box;
}

/* ── Character HUD (right-side active-character transport) ─────────────── */

.character-hud {
    width: 560px;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: 14px 14px 14px 12px;
    color: #f4f4f4;
    background: rgba(0, 0, 0, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    backdrop-filter: blur(6px);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.character-hud--fixed {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
}

.character-hud.is-compact {
    width: 320px;
}

.character-hud__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.character-hud__title-wrap {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.character-hud__header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
}

.character-hud__export-config,
.character-hud__compact-toggle {
    flex: 0 0 auto;
    min-width: 74px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.10);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
}

.character-hud__export-config:hover,
.character-hud__compact-toggle:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.20);
}

.character-hud__export-config {
    min-width: 110px;
}

.character-hud__export-config[hidden] {
    display: none !important;
}

.character-hud__title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.98;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__status {
    font-size: 14px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.78);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
}

.character-hud__tab-button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.character-hud__tab-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
}

.character-hud__tab-button.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.34);
}

.character-hud__tab-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.character-hud__tab-panel--animations {
    flex: 1 1 auto;
    overflow: hidden;
}

.character-hud__settings {
    flex: 1 1 auto;
    overflow: auto;
}

.character-hud__tab-panel[hidden] {
    display: none !important;
}

.character-hud__transport {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.character-hud__button {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    color: #f4f4f4;
    background: rgba(255, 255, 255, 0.11);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
    cursor: pointer;
}

.character-hud__button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
}

.character-hud__button:disabled {
    opacity: 0.45;
    cursor: default;
}

.character-hud__settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.character-hud__settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.character-hud__settings-title {
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.character-hud__settings-meta {
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.character-hud__settings-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.character-hud__settings-panel-title {
    margin-top: 6px;
    padding: 5px 8px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-hud__setting-row {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.20);
    min-width: 0;
}

.character-hud__setting-row.is-favorite {
    border-color: rgba(255, 210, 120, 0.34);
    background: rgba(70, 45, 0, 0.28);
}

.character-hud__setting-favorite-button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.08);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.character-hud__setting-favorite-button:hover,
.character-hud__setting-favorite-button.is-favorite {
    color: rgba(255, 225, 130, 0.98);
    background: rgba(255, 200, 90, 0.16);
    border-color: rgba(255, 220, 120, 0.35);
}

.character-hud__setting-main {
    min-width: 0;
}

.character-hud__setting-label {
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__setting-path {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__setting-value {
    max-width: 120px;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(0, 0, 0, 0.24);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__settings-empty {
    padding: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    line-height: 1.35;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 9px;
}

.character-hud__range {
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.character-hud__range-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.character-hud__range-label {
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.character-hud__range-value {
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.24);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.character-hud__range-slider {
    width: 100%;
    box-sizing: border-box;
}

.character-hud__actions {
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.character-hud__actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.character-hud__actions-title {
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.character-hud__actions-meta {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.character-hud__actions-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.character-hud__action-row {
    box-sizing: border-box;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.20);
    min-width: 0;
}

.character-hud__action-row--disabled {
    border-color: rgba(160, 70, 70, 0.34);
    background: rgba(45, 8, 8, 0.42);
}

.character-hud__action-row--disabled .character-hud__action-label {
    color: rgba(255, 190, 190, 0.78);
    font-weight: 500;
}

.character-hud__action-row--disabled .character-hud__action-source {
    color: rgba(255, 170, 170, 0.56);
}

.character-hud__action-label {
    color: rgba(255, 255, 255, 0.94);
    font-size: 13px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__action-source {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__actions-empty {
    padding: 8px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    line-height: 1.35;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 9px;
}

/* Character HUD action edit/delete controls */
.character-hud__action-row--with-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.character-hud__action-main {
    min-width: 0;
}

.character-hud__action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.character-hud__action-button {
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.10);
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
}

.character-hud__action-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.20);
}

.character-hud__action-button.is-action-disabled {
    color: rgba(185, 185, 185, 0.72);
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(110, 110, 110, 0.12);
    opacity: 0.72;
}

.character-hud__action-button.is-action-disabled:hover {
    color: rgba(215, 215, 215, 0.86);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(130, 130, 130, 0.18);
}

.character-hud__action-button--delete {
    color: rgba(255, 190, 190, 0.95);
    border-color: rgba(255, 120, 120, 0.28);
}

.character-hud__action-button--toggle {
    color: rgba(255, 210, 180, 0.95);
    border-color: rgba(255, 160, 90, 0.30);
}

.character-hud__action-button--toggle.is-enabled {
    color: rgba(190, 255, 210, 0.95);
    border-color: rgba(120, 255, 165, 0.30);
}

.character-hud-edit {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 560px;
    height: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    padding: 14px;
    color: #f4f4f4;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    pointer-events: auto;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 10020;
}

.character-hud.is-compact ~ .character-hud-edit,
.character-hud-edit.is-compact-anchor {
    right: 0;
    width: 320px;
}

.character-hud-edit__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.character-hud-edit__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.character-hud-edit__close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.10);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.character-hud-edit__source {
    padding: 8px 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.66);
    background: rgba(0, 0, 0, 0.24);
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud-edit__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.character-hud-edit__input {
    box-sizing: border-box;
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 9px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.28);
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.character-hud-edit__input:focus {
    border-color: rgba(255, 255, 255, 0.48);
}

.character-hud-edit__status {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    line-height: 1.35;
}

.character-hud-edit__buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.character-hud-edit__button {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.10);
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.character-hud-edit__button--primary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.34);
}

.character-hud__debug {
    margin-top: 8px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    background: rgba(0,0,0,0.35);
    color: rgba(255,255,255,0.86);
    font-size: 11px;
    max-height: 220px;
    overflow: auto;
}

.character-hud__debug summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 4px;
}

.character-hud__debug-body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 10px;
    line-height: 1.35;
}

.character-hud-edit {
    max-height: none;
    overflow: hidden;
}

.character-hud-edit__settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    max-height: 42vh;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.character-hud-edit__settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.character-hud-edit__settings-title {
    color: rgba(255, 255, 255, 0.86);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.character-hud-edit__settings-meta {
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.character-hud-edit__settings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: auto;
}

.character-hud-edit__settings-panel-title {
    margin-top: 4px;
    padding: 3px 2px 1px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-hud-edit__setting-row {
    display: grid;
    grid-template-columns: minmax(86px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.22);
}

.character-hud-edit__setting-label-wrap {
    min-width: 0;
}

.character-hud-edit__setting-label {
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud-edit__setting-panel {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud-edit__setting-control {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.character-hud-edit__setting-range {
    min-width: 0;
    flex: 1 1 auto;
}

.character-hud-edit__setting-number {
    width: 64px;
    box-sizing: border-box;
    padding: 5px 6px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 7px;
    color: #fff;
    background: rgba(0, 0, 0, 0.28);
    font-size: 11px;
    font-weight: 750;
}

.character-hud-edit__setting-text,
.character-hud-edit__setting-select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 7px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 7px;
    color: #fff;
    background: rgba(0, 0, 0, 0.30);
    font-size: 12px;
    font-weight: 750;
}

.character-hud-edit__setting-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 850;
}

.character-hud-edit__settings-empty {
    padding: 8px 4px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
    line-height: 1.35;
}

/* Compact Character HUD: keep action edit access visible while preserving width. */
.character-hud.is-compact .character-hud__actions {
    padding-left: 7px;
    padding-right: 7px;
}

.character-hud.is-compact .character-hud__action-row--with-buttons {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.character-hud.is-compact .character-hud__action-button {
    min-width: 44px;
    min-height: 30px;
    padding: 5px 7px;
    font-size: 11px;
}

.character-hud.is-compact .character-hud__action-source {
    font-size: 11px;
}

/* Character HUD Controller tab: image-layer gamepad monitor. */
.character-hud__controller {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    gap: 10px;
}

.character-hud__controller-wrap {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.character-hud__controller-monitor {
    position: relative;
    width: 100%;
    aspect-ratio: 1672 / 941;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.42);
}

.character-hud__controller-layer {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.character-hud__controller-layer--base {
    opacity: 1;
    z-index: 1;
}

.character-hud__controller-layer--overlay {
    opacity: 0;
    z-index: 2;
    transition: opacity 45ms linear;
}

.character-hud__controller-layer--overlay.is-active {
    opacity: 1;
}

.character-hud__controller-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.character-hud__controller-status {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-hud__controller-hint {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.48);
    text-transform: uppercase;
}

.character-hud.is-compact .character-hud__controller-footer {
    flex-direction: column;
    align-items: stretch;
}
