/* The menu shell owns scrolling and its footer. Keep option forms in that flow. */
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .mobile-menu-content,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .mobile-menu-view,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 12px 14px 24px;
    overflow: visible;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts fieldset {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts legend,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts .label,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts .item,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts .list-item,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts p {
    overflow-wrap: anywhere;
}

/* Checkbox images are 18px game sprites. Enlarge the surrounding label's hit area,
   not the sprite box, or adjacent image frames appear inside the checkbox. */
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .opts input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0 10px 0 0;
    background-repeat: no-repeat;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .item,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .slider-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .item > label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .item span.label,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .slider-item span.label {
    display: block;
    width: 100%;
    min-width: 0;
    flex: none;
    text-align: left;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .item > div,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .item > label > div,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .slider-item > div,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .slider-item input[type="range"] {
    width: calc(100% - 54px);
    min-width: 0;
    height: 44px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .general-opts .slider-item input[type="text"] {
    width: 50px;
    height: 44px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts {
    display: block;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .slider-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .slider-item span.label,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .slider-item > div {
    width: 100%;
    min-width: 0;
    margin: 0;
    text-align: left;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .slider-item span.label {
    flex: none;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts input[type="range"] {
    width: calc(100% - 54px);
    min-width: 0;
    height: 44px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .slider-item input[type="text"] {
    width: 50px;
    height: 44px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .music-jukebox .jukebox-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .music-jukebox .controls {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    gap: 8px 16px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .music-jukebox .controls > div {
    min-height: 44px;
    margin: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .music-jukebox .controls label {
    display: flex;
    align-items: center;
    min-height: 44px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .music-jukebox .playlist {
    width: 100%;
    height: auto;
    max-height: 200px;
    min-height: 88px;
    box-sizing: border-box;
    overflow-y: auto;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .music-jukebox .playlist .list-item {
    min-height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .sound-opts .music-jukebox .jukebox-footer {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 8px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts {
    position: static;
    top: auto;
    transform: none;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-list,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-cur-assign,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-ch-assign {
    flex-direction: column;
    height: auto;
    gap: 8px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-left,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-right {
    width: 100%;
    min-width: 0;
    margin: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-list .key-opts-right {
    justify-content: flex-start;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-list {
    width: 100%;
    height: auto;
    max-height: min(35vh, 240px);
    box-sizing: border-box;
    overflow-y: auto;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-list .list-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
    white-space: normal;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-desc-container {
    height: auto;
    min-height: 64px;
    margin: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-ch-assign .key-opts-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-ch-assign input {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .key-opts .key-opts-ch-assign-warn {
    margin: 12px 0 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .language-opts .language-select,
#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .language-opts .language-select label {
    width: 100%;
    min-width: 0;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .language-opts .language-select label {
    flex-direction: column;
    align-items: stretch;
}

#ra2web-root[data-mobile-menu="true"] .mobile-menu-shell .language-opts .language-select select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
