/* Базовые структурные стили для группового режима */
.player-container section.room-wrapper {
    z-index: 99;
    height: var(--player-height);
    position: relative;
    background-color: var(--average-color, #141414);
    transition: background-color .3s;
}

.room-wrapper {
    display: flex;
    color: var(--text-color, #fff);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;

    .room-container {
        display: flex;
        justify-content: center;
        position: relative;
        z-index: 99;
        padding-top: 46px;
    }
}

/* Лобби - выбор/создание комнаты */
.room-lobby {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.room-header h2 {
    margin: 0;
    text-align: center;
}

.room-join-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.room-code-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.room-button {
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: opacity 0.2s;
    background: var(--text-color, #fff);
}

.room-button:hover {
    opacity: 0.8;
}

.room-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.room-button.primary {
    width: 100%;
}

.room-button.danger {
    width: 100%;
}

.room-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

.room-divider::before,
.room-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid currentColor;
    opacity: 0.3;
}

.room-divider span {
    padding: 0 16px;
    opacity: 0.6;
}

/* Активная комната */
.room-active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.room-active.hidden {
    display: none;
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-code-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.room-code-display .label {
    opacity: 0.7;
}

.room-code-display .code {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 4px;
    flex: 1;
}

.icon-button {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    transition: opacity 0.2s;
}

.icon-button:hover {
    opacity: 0.7;
}

.icon-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Список участников */
.participants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.participants-list h3 {
    margin: 0;
}

#participants-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.participant-name {
    font-weight: 500;
}

.participant-role {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0.7;
}

.participant-role.host {
    opacity: 1;
}

.participant-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.participant-actions {
    display: flex;
    gap: 8px;
}

/* Управление комнатой */
.room-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* Режим участника - ограничение контролов */
.player-wrapper.participant .previous-button,
.player-wrapper.participant .next-button,
.player-wrapper.participant .timecode-slider,
.player-wrapper.participant .repeat-button,
.player-wrapper.participant .shuffle-button {
    pointer-events: none;
    opacity: 0.3;
}

/* Индикатор группового режима */
.playing-now-textblock {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playing-now-textblock .subtitle {
    font-size: 12px;
    opacity: 0.7;
}

.playing-now-textblock .title {
    font-size: 14px;
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 768px) {
    .room-code-display .code {
        font-size: 20px;
    }

    .participant-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .participant-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Утилиты */
.hidden {
    display: none !important;
}