/* 読み込み画面を除くクライアントUIで使用するIBM公式フォント。 */
@font-face {
    font-family: 'IBM Plex Sans JP UI';
    src: url('../assets/fonts/IBM_Regular/IBMPlexSansJP-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans JP UI';
    src: url('../assets/fonts/IBM_SemiBold/IBMPlexSansJP-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent-color: #0043ce;
    --accent-color-hover: #0f62fe;
    --accent-color-soft: rgba(0, 67, 206, 0.24);
    --accent-color-muted: rgba(0, 67, 206, 0.14);
    --accent-color-border: rgba(0, 67, 206, 0.58);
    --accent-color-text: #a6c8ff;
    --accent-color-heading: #78a9ff;
}

body,
button,
input,
select,
textarea {
    font-family: 'IBM Plex Sans JP UI', sans-serif;
}

body {
    background-color: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
    font-weight: 600;
}

#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#application-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    opacity: 1;
    transition: opacity 0.25s ease;
}

#application-canvas:active {
    cursor: grabbing;
}

#app-container.show-title #application-canvas {
    opacity: 1;
}

#main-ui.hidden {
    display: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.player-nameplate {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 650;
    padding: 7px 12px;
    border-radius: 14px;
    background: rgba(8, 14, 20, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, calc(-100% + 10px));
    backdrop-filter: blur(8px);
}

.player-nameplate-content {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.player-nameplate-mic {
    position: relative;
    width: 16px;
    height: 16px;
    display: none;
    flex: 0 0 auto;
    overflow: hidden;
}

.player-nameplate[data-microphone-active="true"] .player-nameplate-mic {
    display: inline-block;
}

.player-nameplate-mic::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: url('../assets/UI/icons/icon_mic_unmute.svg') center / contain no-repeat;
}

.player-nameplate-mic-level {
    position: absolute;
    left: 6px;
    bottom: 5px;
    z-index: 1;
    width: 4px;
    height: calc(var(--mic-level, 0) * 8px);
    min-height: 0;
    border-radius: 999px;
    background: var(--accent-color-hover);
    transition: height 0.06s linear;
}

.player-nameplate.hidden {
    display: none;
}

#local-player-nameplate {
    z-index: 660;
}

.remote-nameplate {
    background: rgba(13, 20, 30, 0.78);
}

.performance-hud {
    position: absolute;
    top: 68px;
    left: 20px;
    z-index: 700;
    min-width: 176px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(8, 14, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.performance-hud.hidden {
    display: none;
}

.performance-hud-title {
    margin-bottom: 8px;
    color: var(--accent-color-heading);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.performance-hud-body {
    white-space: pre-line;
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

/* 先端の外枠。枠線色だけを 1 枚下に置き、吹き出し本体との境界を作る。 */
.player-nameplate::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 11px solid rgba(255, 255, 255, 0.14);
}

/* 先端の内側。本体色の三角を少し上に重ねて、外枠付きの吹き出しに見せる。 */
.player-nameplate::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 10px solid rgba(8, 14, 20, 0.82);
}

.screen-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 900;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 35%),
        linear-gradient(160deg, rgba(10, 12, 14, 0.92), rgba(22, 24, 28, 0.84));
}

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

.dialog-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 950;
    background: rgba(4, 8, 12, 0.56);
    backdrop-filter: blur(6px);
}

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

.dialog-card {
    width: min(100%, 420px);
    padding: 28px 24px;
    border-radius: 20px;
    background: rgba(10, 16, 24, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.dialog-card h2 {
    margin-bottom: 10px;
    font-size: 24px;
}

.dialog-card p {
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.6;
}

.dialog-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.create-meeting-room-error {
    margin-top: 10px;
    color: #ff7b7b;
    font-size: 13px;
    line-height: 1.5;
}

.create-meeting-room-error.hidden {
    display: none;
}

.screen-card {
    width: min(100%, 560px);
    padding: 40px 36px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(6, 10, 16, 0.74);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.screen-eyebrow {
    margin-bottom: 12px;
    color: var(--accent-color-heading);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.screen-card h1 {
    margin-bottom: 14px;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.05;
}

.screen-description {
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    line-height: 1.7;
}

.name-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 auto 20px;
    text-align: left;
    width: min(100%, 320px);
}

.name-input-group span {
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.name-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 14, 20, 0.84);
    color: #ffffff;
    font-size: 15px;
    outline: none;
}

.name-input:focus {
    border-color: var(--accent-color-border);
    box-shadow: 0 0 0 3px var(--accent-color-muted);
}

select.name-input {
    appearance: none;
    cursor: pointer;
}

.primary-button,
.secondary-button {
    border: 0;
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent-color-hover), var(--accent-color));
    color: #ffffff;
}

.secondary-button {
    background: rgba(9, 16, 24, 0.78);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
    opacity: 0.96;
}

#controls-info {
    position: absolute;
    bottom: 92px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 300px;
}

#controls-info.hidden {
    display: none;
}

#main-ui.model-viewer-ui-suppressed #local-player-nameplate,
#main-ui.model-viewer-ui-suppressed .virtual-fellow-nameplate,
#main-ui.model-viewer-ui-suppressed #performance-hud,
#main-ui.model-viewer-ui-suppressed #controls-info,
#main-ui.model-viewer-ui-suppressed #top-session-bar,
#main-ui.model-viewer-ui-suppressed #avatar-editor-panel,
#main-ui.model-viewer-ui-suppressed #debug-menu,
#main-ui.model-viewer-ui-suppressed #chat-panel,
#main-ui.model-viewer-ui-suppressed #user-list-panel,
#main-ui.model-viewer-ui-suppressed #settings-panel,
#main-ui.model-viewer-ui-suppressed #screen-share-fullscreen-viewer {
    display: none !important;
}

#main-ui.model-viewer-ui-suppressed #bottom-menu-bar > * {
    display: none !important;
}

#main-ui.model-viewer-ui-suppressed #bottom-menu-bar > #microphone-toggle-button,
#main-ui.model-viewer-ui-suppressed #bottom-menu-bar > #spatial-audio-toggle-button {
    display: inline-flex !important;
}

#controls-info h3 {
    margin-bottom: 10px;
    font-size: 18px;
    color: var(--accent-color-heading);
}

#controls-info ul {
    list-style: none;
    padding: 0;
}

#controls-info li {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

#controls-info strong {
    color: var(--accent-color-text);
    font-weight: 600;
}

.top-session-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.top-session-bar > * {
    pointer-events: auto;
}

.top-leave-button {
    flex: 0 0 auto;
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: rgba(8, 14, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.top-leave-button:hover {
    transform: translateY(-1px);
    background: rgba(8, 14, 20, 0.94);
}

.button-icon,
.menu-button-icon,
.close-button-icon {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.leave-button-icon {
    width: 18px;
    height: 15px;
}

.close-button-icon {
    width: 10px;
    height: 10px;
}

.bottom-menu-bar {
    position: absolute;
    left: 50%;
    bottom: 26px;
    z-index: 720;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(8, 14, 20, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
}

.menu-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.menu-icon-button:hover,
.menu-icon-button[data-active="true"] {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateY(-1px);
}

.menu-icon-button:disabled {
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.32);
    transform: none;
}

.menu-icon-button:disabled:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.32);
    transform: none;
}

.menu-button-icon {
    width: 20px;
    height: 20px;
    opacity: 0.9;
    position: relative;
    z-index: 2;
    transition: opacity 0.15s ease;
}

.menu-icon-button:hover .menu-button-icon,
.menu-icon-button[data-active="true"] .menu-button-icon {
    opacity: 1;
}

.menu-icon-button:disabled .menu-button-icon {
    opacity: 0.35;
}

.avatar-thumb-button {
    width: 34px;
    height: 34px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    border: none;
    outline: none;
}

.avatar-thumb-button:hover,
.avatar-thumb-button[data-active="true"] {
    transform: translateY(-1px);
}

.avatar-thumb-img {
    width: 100%;
    height: 100%;
    margin-left: 0%;
    margin-top: -15%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    opacity: 1;
}

.microphone-menu-button {
    position: relative;
}

.microphone-menu-button[data-active="true"] {
    background: var(--accent-color-soft);
    color: #edf5ff;
}

.microphone-menu-level {
    position: absolute;
    left: 15px;
    bottom: 13px;
    z-index: 1;
    display: none;
    width: 4px;
    height: calc(var(--mic-level, 0) * 10px);
    min-height: 0;
    border-radius: 999px;
    background: var(--accent-color-hover);
    pointer-events: none;
    transition: height 0.06s linear;
}

.microphone-menu-button[data-active="true"] .microphone-menu-level {
    display: block;
}

.microphone-icon-unmuted {
    display: none;
}

.microphone-menu-button[data-active="true"] .microphone-icon-muted {
    display: none;
}

.microphone-menu-button[data-active="true"] .microphone-icon-unmuted {
    display: block;
}

.spatial-audio-menu-button[data-active="true"] {
    background: var(--accent-color-soft);
    color: #edf5ff;
}

.chat-menu-button[data-active="true"],
.virtual-fellow-menu-button[data-active="true"] {
    background: var(--accent-color-soft);
    color: #edf5ff;
}

.avatar-thumb-button[data-active="true"] {
    background: var(--accent-color-soft);
}

#debug-button[data-active="true"] {
    background: var(--accent-color-soft);
    color: #edf5ff;
}

.chat-menu-button {
    position: relative;
}

.chat-menu-button.has-unread {
    color: #ffffff;
}

.chat-unread-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff5252;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(8, 14, 20, 0.96);
}

.chat-unread-badge.hidden {
    display: none;
}

#debug-button {
    z-index: 700;
}

#network-status {
    flex: 0 1 auto;
    min-width: 0;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(8, 14, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(10px);
}

#network-status[data-tone="success"] {
    color: #9af0a1;
    border-color: rgba(122, 229, 130, 0.45);
}

#network-status[data-tone="pending"] {
    color: #ffe082;
    border-color: rgba(255, 224, 130, 0.38);
}

#network-status[data-tone="error"] {
    color: #ffab91;
    border-color: rgba(255, 171, 145, 0.4);
}

.livekit-connection-status {
    flex: 0 0 auto;
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 14px;
    border-radius: 999px;
    background: rgba(8, 14, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.livekit-connection-status.hidden,
.livekit-connection-status .hidden {
    display: none;
}

.livekit-connection-status[data-tone="connected"] {
    color: #9af0a1;
    border-color: rgba(122, 229, 130, 0.45);
}

.livekit-connection-status[data-tone="connecting"],
.livekit-connection-status[data-tone="reconnecting"] {
    color: #ffe082;
    border-color: rgba(255, 224, 130, 0.38);
}

.livekit-connection-status[data-tone="disconnected"] {
    color: #ffab91;
    border-color: rgba(255, 171, 145, 0.4);
}

.livekit-reconnect-button {
    min-height: 26px;
    padding: 0 12px;
    border: 1px solid rgba(255, 171, 145, 0.38);
    border-radius: 999px;
    background: rgba(255, 171, 145, 0.12);
    color: #ffccbc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.livekit-reconnect-button:hover {
    background: rgba(255, 171, 145, 0.2);
}

.livekit-reconnect-button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.livekit-reconnect-button:disabled:hover {
    background: rgba(255, 171, 145, 0.12);
}

#debug-menu {
    position: absolute;
    left: 50%;
    bottom: 78px;
    z-index: 700;
    width: min(300px, calc(100vw - 40px));
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(8, 14, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    transform: translateX(-50%);
}

#debug-menu.hidden {
    display: none;
}

#debug-menu h3 {
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--accent-color-heading);
}

.debug-menu-toggle[data-active="true"] {
    background: var(--accent-color-soft);
    border-color: var(--accent-color-border);
    color: #edf5ff;
}

#debug-menu p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.6;
}

.debug-menu-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.debug-menu-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
}

.debug-menu-action {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(79, 140, 255, 0.18);
    color: #edf5ff;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.debug-menu-action:hover {
    background: rgba(79, 140, 255, 0.28);
}

.virtual-fellow-animation-debug-panel {
    position: absolute;
    top: 50%;
    left: max(16px, env(safe-area-inset-left));
    z-index: 780;
    width: min(520px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 32px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(8, 14, 20, 0.96);
    color: #ffffff;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
    transform: translateY(-50%);
    backdrop-filter: blur(14px);
}

.virtual-fellow-animation-debug-panel.hidden {
    display: none;
}

.virtual-fellow-animation-debug-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.virtual-fellow-animation-debug-header h2 {
    margin: 0;
    color: var(--accent-color-heading);
    font-size: 18px;
}

.virtual-fellow-animation-debug-header p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.5;
}

.virtual-fellow-animation-debug-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(min(720px, 100vh - 32px) - 86px);
    padding: 16px 20px 20px;
    overflow-y: auto;
}

.virtual-fellow-debug-field {
    display: grid;
    gap: 6px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.virtual-fellow-debug-field select {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: #121a22;
    color: #ffffff;
}

.virtual-fellow-debug-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.virtual-fellow-debug-status div {
    min-width: 0;
    padding: 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
}

.virtual-fellow-debug-status dt {
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
}

.virtual-fellow-debug-status dd {
    margin: 5px 0 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.virtual-fellow-animation-debug-body h3 {
    margin: 0 0 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
}

.virtual-fellow-debug-grid,
.virtual-fellow-debug-transitions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.virtual-fellow-debug-grid button,
.virtual-fellow-debug-action {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.virtual-fellow-debug-grid button:hover,
.virtual-fellow-debug-action:hover {
    background: rgba(79, 140, 255, 0.2);
}

.virtual-fellow-debug-grid button[data-active="true"] {
    border-color: var(--accent-color-border);
    background: var(--accent-color-soft);
    color: #ffffff;
}

.virtual-fellow-debug-action:disabled {
    opacity: 0.45;
    cursor: wait;
}

.virtual-fellow-debug-note {
    margin: 0;
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
    line-height: 1.5;
}

@media (max-width: 560px) {
    .virtual-fellow-debug-status,
    .virtual-fellow-debug-grid,
    .virtual-fellow-debug-transitions {
        grid-template-columns: 1fr;
    }
}

.toast-container {
    position: absolute;
    left: 50%;
    bottom: 78px;
    z-index: 760;
    width: min(420px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    transform: translateX(-50%);
}

.screen-share-fullscreen-viewer {
    position: absolute;
    inset: 0;
    z-index: 760;
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: rgba(3, 6, 10, 0.9);
    backdrop-filter: blur(10px);
}

.screen-share-fullscreen-viewer.hidden {
    display: none;
}

.screen-share-fullscreen-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.screen-share-fullscreen-header h2 {
    margin: 0 0 4px;
    font-size: 17px;
}

.screen-share-fullscreen-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
}

.screen-share-fullscreen-video-wrap {
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.screen-share-fullscreen-video-wrap video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #000000;
}

.toast-message {
    width: fit-content;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(22, 26, 32, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(12px);
}

.toast-message[data-tone="error"] {
    background: rgba(62, 24, 28, 0.95);
    border-color: rgba(255, 112, 112, 0.42);
    color: #ffe8e8;
}

.toast-message.is-hiding {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.remote-audio-container {
    display: none;
}

/* ─── アバターエディターパネル ─── */
.avatar-editor-panel {
    position: absolute;
    right: 16px;
    bottom: 76px;
    z-index: 730;
    width: min(280px, calc(100vw - 32px));
    max-height: calc(100vh - 102px);
    max-height: calc(100dvh - 102px);
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: rgba(11, 13, 16, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    overflow: clip;
}

.avatar-editor-panel.hidden {
    display: none;
}

.avatar-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.avatar-editor-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.avatar-editor-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.avatar-editor-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
}

.avatar-editor-section:last-child {
    border-bottom: none;
}

/* 大ラベル（Nickname / Avatar） */
.avatar-editor-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

/* アンダーライン型入力欄 */
.avatar-editor-name-input {
    width: 100%;
    padding: 4px 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.avatar-editor-name-input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.7);
}

.avatar-editor-name-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* ブラウザの入力履歴／オートフィル選択後もアバター設定の配色を維持する。 */
.avatar-editor-name-input:is(:-webkit-autofill, :autofill),
.avatar-editor-name-input:is(:-webkit-autofill, :autofill):hover,
.avatar-editor-name-input:is(:-webkit-autofill, :autofill):focus,
.avatar-editor-name-input:is(:-webkit-autofill, :autofill):active {
    appearance: none;
    color: rgba(255, 255, 255, 0.72);
    caret-color: #ffffff;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background-color: transparent !important;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.72);
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    transition: background-color 9999s ease-out 0s;
}

/* アバタープリセット – 5列グリッド、名前なし */
.avatar-editor-preset-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.avatar-editor-preset-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s;
}

.avatar-editor-preset-item:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.avatar-editor-preset-item.selected {
    border-color: rgba(255, 255, 255, 0.9);
}

.avatar-editor-preset-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.avatar-editor-preset-thumb-img {
    width: 140%;
    height: 140%;
    margin-left: -20%;
    margin-top: -30%;
    object-fit: cover;
    display: block;
}

/* preset-name は非表示 */
.avatar-editor-preset-name {
    display: none;
}

/* カスタマイズ行（Hair / Top / Bottoms） */
.avatar-editor-section-disabled {
    opacity: 0.6;
    pointer-events: none;
    gap: 0;
}

.avatar-editor-custom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.avatar-editor-custom-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.avatar-editor-custom-row.unavailable {
    opacity: 0.45;
}

.avatar-editor-custom-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-editor-custom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.avatar-editor-custom-icon-img {
    display: block;
    max-width: 16px;
    max-height: 16px;
    filter: brightness(0) saturate(100%) invert(50%);
}

/* メイン画面のアバター選択パネルでは、アイコン背景と行の区切りを表示しない。 */
.avatar-editor-panel .avatar-editor-custom-row {
    border-bottom: 0;
}

.avatar-editor-panel .avatar-editor-custom-icon {
    border-radius: 0;
    background: transparent;
}

.avatar-editor-custom-label {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

.avatar-editor-swatches {
    display: flex;
    gap: 5px;
    align-items: center;
}

.avatar-editor-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background-color: rgba(255, 255, 255, 0.12);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    cursor: pointer;
    appearance: none;
    transition: box-shadow 0.15s, opacity 0.15s, transform 0.15s;
}

.avatar-editor-swatch:hover:not(:disabled):not(.selected) {
    transform: scale(1.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.avatar-editor-swatch.selected {
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.7),
        0 0 0 2px #ffffff,
        0 0 0 3px rgba(0, 0, 0, 0.5);
}

.avatar-editor-swatch:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.avatar-editor-swatch:disabled {
    cursor: wait;
    opacity: 0.55;
}

.chat-panel {
    position: absolute;
    top: 26px;
    right: 16px;
    bottom: 76px;
    z-index: 730;
    width: min(280px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(11, 13, 16, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
}

.chat-panel.hidden {
    display: none;
}

.chat-panel-header {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-panel-header h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
}

.chat-close-button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    cursor: pointer;
}

.chat-close-button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.chat-message-list {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 16px;
}

.chat-empty-message {
    margin: auto;
    color: rgba(255, 255, 255, 0.52);
    font-size: 13px;
    text-align: center;
}

.chat-message {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
    padding: 2px 0 8px;
}

.chat-message-local .chat-message-avatar {
    border: 2px solid rgba(0, 67, 206, 1.00);
    background: rgb(191, 213, 255);
    box-shadow:
        0 0 0 2px rgba(0, 67, 206, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.22);
}

.chat-message-system {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 224, 130, 0.1);
    border: 1px solid rgba(255, 224, 130, 0.18);
}

.chat-message-system .chat-message-avatar {
    display: none;
}

.chat-message-error {
    background: rgba(255, 120, 120, 0.12);
    border-color: rgba(255, 120, 120, 0.28);
}

.chat-message-error .chat-message-sender {
    color: #ffccbc;
}

.chat-message-error .chat-message-body {
    color: rgba(255, 236, 232, 0.94);
}

.chat-message-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 1);
    border: 0.5px solid rgba(255, 255, 255, 1);
    color: #102033;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.chat-message-avatar-img {
    width: 110%;
    height: 110%;
    margin-left: 0%;
    margin-top: 0%;
    object-fit: cover;
    display: block;
}

.chat-message-content {
    min-width: 0;
}

.chat-message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    margin-bottom: 3px;
}

.chat-message-sender {
    min-width: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-time {
    color: rgba(255, 255, 255, 0.48);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.chat-message-body {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input-wrap {
    flex: 1;
    min-width: 0;
}

.chat-input {
    width: 100%;
    max-height: 92px;
    resize: none;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
}

.chat-input:focus {
    border-color: var(--accent-color-border);
    box-shadow: 0 0 0 3px var(--accent-color-muted);
}

.chat-input:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}

.chat-character-count {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 11px;
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.chat-character-count[data-near-limit="true"] {
    color: #ffe082;
}

.chat-send-button {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-color-soft);
    color: #edf5ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.chat-send-button:hover {
    background: rgba(0, 67, 206, 0.34);
}

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

.room-list-card {
    width: min(100%, 440px);
    text-align: left;
}

.warp-room-list-card {
    width: min(100%, 720px);
}

.warp-dialog-footer {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.screen-share-dialog-card {
    width: min(100%, 420px);
}

.room-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.room-list-header h2 {
    margin: 0;
}

.room-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.room-list-refresh-button {
    font-size: 18px;
    line-height: 1;
}

.room-list-feedback {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.6;
}

.room-list-feedback.hidden {
    display: none;
}

.room-list-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.warp-room-grid-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
}

.room-list-item {
    --room-list-normal-image: none;
    --room-list-hover-image: var(--room-list-normal-image);
    position: relative;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 48px 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.04);
    background-image: var(--room-list-normal-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #ffffff;
    cursor: default;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.warp-room-grid-items .room-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-height: 104px;
    padding: 14px 48px 14px 16px;
}

.room-list-item:hover {
    transform: translateY(-1px);
    background-color: var(--accent-color-muted);
    background-image: var(--room-list-hover-image);
    border-color: rgba(0, 67, 206, 0.36);
}

.warp-room-grid-items .room-list-item:hover {
    transform: none;
    background-color: var(--accent-color-muted);
    border-color: rgba(0, 67, 206, 0.36);
}

.room-list-item[data-current="true"] {
    background-color: var(--accent-color-muted);
    border-color: var(--accent-color-border);
}

.room-list-select-button {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.warp-room-grid-items .room-list-select-button {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.room-list-select-button:disabled {
    cursor: default;
}

.room-list-item-name {
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.room-list-item-name,
.room-list-item-meta {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.48);
    transition: color 0.15s ease;
}

.room-list-item-meta {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

.room-list-item:hover .room-list-item-name,
.room-list-item:hover .room-list-item-meta {
    color: var(--accent-color-hover);
    text-shadow: 2px 2px 10px rgba(255, 255, 255, 0.5);
}

.room-list-users-button {
    position: absolute;
    top: 30px;
    right: 18px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.room-list-users-button:hover {
    transform: translateY(-1px);
    background: var(--accent-color-muted);
    border-color: rgba(0, 67, 206, 0.46);
}

.room-list-users-button[aria-expanded="true"] {
    background: var(--accent-color-soft);
    border-color: var(--accent-color-border);
}

.room-list-users-icon {
    width: 13px;
    height: 13px;
    display: block;
    opacity: 0.92;
}

.room-list-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.room-list-user-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
}

.room-list-user-avatar-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.room-list-user-name {
    min-width: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.room-list-users-loading,
.room-list-users-feedback {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.5;
}

.room-participants-overlay {
    z-index: 980;
}

.room-participants-card {
    width: min(100%, 520px);
    height: min(78vh, 680px);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    text-align: left;
    overflow: hidden;
}

.room-participants-search-input {
    width: 100%;
    margin-top: 4px;
}

.room-participants-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 14px;
    padding-right: 4px;
    overflow-y: auto;
}

.room-participant-row {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.room-participant-avatar {
    width: 30px;
    height: 30px;
}

.room-participant-name {
    font-size: 14px;
    font-weight: 600;
}

.room-participants-actions {
    flex: 0 0 auto;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.room-participants-actions .primary-button {
    width: min(100%, 280px);
}

/* ─── 設定パネル ─── */
.settings-panel {
    position: absolute;
    right: 16px;
    bottom: 76px;
    z-index: 730;
    width: min(280px, calc(100vw - 32px));
    max-height: calc(100vh - 102px);
    max-height: calc(100dvh - 102px);
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: rgba(11, 13, 16, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    overflow: clip;
}

.settings-panel.hidden {
    display: none;
}

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px 12px;
    flex-shrink: 0;
}

.settings-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.settings-panel-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.settings-panel-body {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.settings-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}

.settings-row-label {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.settings-toggle-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.settings-toggle-button {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.settings-toggle-button:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

.settings-toggle-button--active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

.settings-toggle-button--active:hover {
    background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 640px) {

    .screen-card {
        padding: 32px 24px;
    }

    #controls-info {
        top: auto;
        bottom: 76px;
        left: 16px;
        max-width: calc(100vw - 32px);
    }

    .top-leave-button {
        height: 44px;
    }

    .top-session-bar {
        top: 16px;
        left: 16px;
        right: 16px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
    }

    .livekit-connection-status {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: space-between;
    }

    .bottom-menu-bar {
        bottom: 16px;
    }

    #debug-menu {
        bottom: 68px;
        width: min(320px, calc(100vw - 32px));
    }

    .avatar-editor-panel {
        right: 12px;
        bottom: 68px;
        width: min(280px, calc(100vw - 24px));
        max-height: calc(100vh - 132px);
        max-height: calc(100dvh - 132px);
    }

    .chat-panel {
        top: 64px;
        right: 12px;
        bottom: 68px;
        width: min(280px, calc(100vw - 24px));
    }

    .settings-panel {
        right: 12px;
        bottom: 68px;
        width: min(280px, calc(100vw - 24px));
        max-height: calc(100vh - 132px);
        max-height: calc(100dvh - 132px);
    }

    .performance-hud {
        top: 64px;
        left: 16px;
        right: auto;
    }

    .room-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .warp-room-grid-items {
        grid-template-columns: repeat(2, 1fr);
        max-height: 280px;
    }

    .dialog-actions {
        flex-direction: column;
    }

    .room-participants-actions {
        flex-direction: row;
        align-items: center;
    }

    .room-participants-card {
        height: calc(100vh - 48px);
    }

}

@media (max-width: 420px) {
    .warp-room-grid-items {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1040px) {
    .avatar-editor-panel {
        bottom: 26px;
        max-height: calc(100vh - 52px);
        max-height: calc(100dvh - 52px);
    }

    .chat-panel {
        bottom: 26px;
    }

    .settings-panel {
        bottom: 26px;
        max-height: calc(100vh - 52px);
        max-height: calc(100dvh - 52px);
    }
}

/* ─── User List パネル ─── */
.user-list-panel {
    position: absolute;
    right: 16px;
    bottom: 76px;
    z-index: 730;
    width: min(300px, calc(100vw - 32px));
    max-height: calc(100vh - 108px);
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: rgba(11, 13, 16, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    overflow: clip;
}

.user-list-panel.hidden {
    display: none;
}

.user-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 10px;
    flex-shrink: 0;
}

.user-list-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-list-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.user-list-mute-all-button {
    min-height: 26px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.user-list-mute-all-button:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.38);
}

.user-list-mute-all-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.user-list-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.user-list-items {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
}

/* ユーザー 1行 */
.user-list-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-list-item:last-child {
    border-bottom: none;
}

/* アバターアイコン */
.user-list-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 1);
    border: 0.5px solid rgba(255, 255, 255, 1);
    color: #102033;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    flex-shrink: 0;
}

.user-list-avatar-img {
    width: 110%;
    height: 110%;
    margin-left: 0%;
    margin-top: 0%;
    object-fit: cover;
    display: block;
}

/* ユーザー名 */
.user-list-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.90);
    font-size: 13px;
    font-weight: 600;
}

/* マイクボタン（右端） */
.user-list-mic-button {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
    overflow: hidden;
}

.user-list-mic-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.user-list-mic-button:disabled {
    cursor: default;
}

.user-list-mic-button:disabled:hover {
    background: transparent;
}

/* マイクON時 */
.user-list-mic-button[data-muted="false"] {
    background: var(--accent-color-soft);
    color: rgba(255, 255, 255, 0.82);
}

/* マイクOFF時 */
.user-list-mic-button[data-muted="true"] {
    color: rgba(255, 255, 255, 0.42);
}

.user-list-mic-icon {
    position: relative;
    z-index: 2;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.user-list-mic-icon-unmuted {
    display: none;
}

/* マイク音量インジケーター（ボタン内） */
.user-list-mic-level {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 1;
    display: none;
    width: 4px;
    height: calc(var(--mic-level, 0) * 10px);
    min-height: 0;
    border-radius: 999px;
    background: var(--accent-color-hover);
    pointer-events: none;
    transition: height 0.06s linear;
}

.user-list-mic-button[data-muted="false"] .user-list-mic-level {
    display: block;
}

.user-list-mic-button[data-muted="false"] .user-list-mic-icon-muted {
    display: none;
}

.user-list-mic-button[data-muted="false"] .user-list-mic-icon-unmuted {
    display: block;
}

/* User List メニューボタン */
.user-list-menu-button[data-active="true"] {
    background: var(--accent-color-soft);
    color: #edf5ff;
}

/* Made with Bob */
