html,
body {
    min-height: 100%;
    margin: 0;
    background: #111820;
    color: #eef3f7;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    padding: 12px 12px 84px;
    box-sizing: border-box;
}

button,
input {
    font: inherit;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#appName {
    margin: 0 0 3px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

#commsInfo,
#backToAppsButton {
    color: #9ed7ff;
    font-size: 13px;
    text-decoration: none;
}

#backToAppsButton {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    line-height: 36px;
}

main {
    max-width: 560px;
    margin: 0 auto;
}

section {
    margin-bottom: 12px;
}

#nowPlaying,
#filePanel,
#queueSection {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: #18232d;
}

#currentTitle {
    overflow: hidden;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#statusLine {
    min-height: 18px;
    overflow: hidden;
    color: #b9c7d4;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#seekSlider,
#volumeSlider {
    width: 100%;
    margin: 12px 0 4px;
}

#timeLine {
    display: flex;
    justify-content: space-between;
    color: #d7e0e8;
    font-size: 13px;
    font-weight: 700;
}

#transport,
#modeControls,
#audioControls,
#displayControls,
#visualizerRemoteControls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#transport button,
#modeControls button,
#audioControls button,
#displayControls button,
#visualizerRemoteControls button,
#selectFilesButton,
#clearButton {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: #263542;
    color: #eef3f7;
    cursor: pointer;
    font-weight: 700;
}

#transport button {
    flex: 1 1 48px;
    min-width: 48px;
    padding: 0;
}

#transport .transportPrimary {
    background: #f7c948;
    color: #111;
}

#transport button.active,
#modeControls button.active,
#audioControls button.active,
#displayControls button.active,
#visualizerRemoteControls button.active {
    background: #8fd0ff;
    color: #081018;
}

#transport svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    vertical-align: middle;
}

#modeControls button,
#displayControls button,
#visualizerRemoteControls button {
    flex: 1 1 31%;
    padding: 0 10px;
    font-size: 13px;
}

#audioControls {
    align-items: center;
}

#audioControls button {
    flex: 0 0 86px;
}

#audioControls label {
    flex: 1 1 160px;
    color: #d7e0e8;
    font-size: 13px;
    font-weight: 700;
}

#musicFiles {
    display: none;
}

#selectFilesButton {
    width: 100%;
    background: #f7c948;
    color: #111;
}

#fileHint,
#chunkStatus {
    margin: 9px 0 0;
    color: #b9c7d4;
    font-size: 13px;
    line-height: 1.35;
}

#queueHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

#queueHeader h2 {
    margin: 0;
    font-size: 18px;
}

#clearButton {
    min-width: 76px;
}

#queueList {
    margin: 0;
    padding: 0;
    list-style: none;
}

.emptyQueue {
    padding: 18px 8px;
    color: #aebdca;
    text-align: center;
}

.queueItem {
    display: flex;
    align-items: stretch;
    min-height: 54px;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #101820;
    will-change: transform;
}

.queueItem.current {
    border-color: #f7c948;
}

.dragHandle,
.removeButton,
.queueTitle {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
}

.dragHandle {
    width: 42px;
    color: #8fd0ff;
    cursor: grab;
    font-size: 22px;
    touch-action: none;
}

.dragHandle:active {
    cursor: grabbing;
}

.queueTitle {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 8px 8px 0;
    text-align: left;
    touch-action: pan-y;
}

.queueLabel {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queueMeta {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #aebdca;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.removeButton {
    width: 44px;
    color: #ff8a96;
    font-size: 24px;
}

.queueItem.dragging {
    opacity: 0.65;
}

body.queue-reordering {
    -webkit-user-select: none;
    user-select: none;
}

#bottomPanel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    min-height: 56px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: #101820;
}

.bottomPanelCell {
    min-width: 0;
}

.bottomPanelCell:first-child {
    flex: 1 1 auto;
}

.roomCell {
    flex: 0 0 auto;
    text-align: right;
}

.bottomPanelLabel {
    display: block;
    margin-bottom: 2px;
    color: #81919f;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

#roomLabel {
    margin: 0;
    color: #d7e0e8;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

#bottomPanel #statusLine {
    display: block;
    color: #d7e0e8;
}

@media (max-width: 360px) {
    body {
        padding-right: 8px;
        padding-left: 8px;
    }

    #modeControls button,
    #displayControls button {
        flex-basis: 100%;
    }
}
