/* 読み込み画面を除くクライアント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;
}

.reaction-menu-anchor {
    position: relative;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

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

.reaction-menu {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 14px);
    z-index: 760;
    display: grid;
    gap: 4px;
    min-width: 184px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(8, 14, 20, 0.94);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(12px);
    /* 項目アイコンの中心を、直下のリアクションボタンの中心へ揃える。 */
    transform: translateX(-34px);
}

.reaction-menu.hidden {
    display: none;
}

.reaction-menu-item {
    width: 100%;
    min-height: 30px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.reaction-menu-item:hover,
.reaction-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    outline: none;
}

.reaction-menu-item:disabled {
    color: rgba(255, 255, 255, 0.34);
    cursor: not-allowed;
}

.reaction-menu-item:disabled:hover {
    background: transparent;
}

.reaction-menu-item img {
    width: 20px;
    height: 22px;
    object-fit: contain;
    justify-self: center;
    pointer-events: none;
}

.reaction-shortcut-key {
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    font-size: 9px;
    box-shadow: none;
    pointer-events: none;
}

.reaction-menu-item:hover .reaction-shortcut-key,
.reaction-menu-item:focus-visible .reaction-shortcut-key {
    color: rgba(255, 255, 255, 0.86);
}

.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;
}

/* ─── Ping 接続状態インジケーター ─── */

.ping-connection-status {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #22a447;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: background-color 0.25s ease, border-color 0.25s ease;
    cursor: default;
}

.ping-connection-status.hidden {
    display: none;
}

.ping-status-icon {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    filter: none;
}

/* connected (green) */
.ping-connection-status[data-tone="connected"],
.ping-connection-status[data-tone="mock"] {
    background: #22a447;
}

/* warning (yellow) */
.ping-connection-status[data-tone="warning"] {
    background: #e0a800;
}

/* ─── LiveKit 接続状態表示 ─── */

.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);
}

.debug-menu-action:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.sky-time-debug-panel {
    position: absolute;
    right: max(16px, env(safe-area-inset-right));
    bottom: 78px;
    z-index: 780;
    width: min(320px, calc(100vw - 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);
    backdrop-filter: blur(14px);
}

.sky-time-debug-panel.hidden {
    display: none;
}

.sky-time-debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sky-time-debug-header h2 {
    margin: 0;
    color: var(--accent-color-heading);
    font-size: 16px;
}

.sky-time-debug-body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.sky-time-debug-time {
    color: #ffffff;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.sky-time-debug-slider {
    width: 100%;
    accent-color: var(--accent-color);
}

.sky-time-debug-realtime {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(79, 140, 255, 0.18);
    color: #edf5ff;
    font: inherit;
    cursor: pointer;
}

.sky-time-debug-realtime:hover {
    background: rgba(79, 140, 255, 0.28);
}

.screen-effects-debug-panel {
    position: absolute;
    right: max(16px, env(safe-area-inset-right));
    bottom: 78px;
    z-index: 780;
    width: min(360px, calc(100vw - 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);
    backdrop-filter: blur(14px);
}

.screen-effects-debug-panel.hidden {
    display: none;
}

.screen-effects-debug-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-effects-debug-header h2 {
    margin: 0;
    color: var(--accent-color-heading);
    font-size: 17px;
}

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

.screen-effects-debug-body {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.screen-effects-debug-field {
    display: grid;
    gap: 7px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 12px;
}

.screen-effects-debug-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: #17212b;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
}

.screen-effects-debug-status {
    display: grid;
    gap: 8px;
    margin: 0;
}

.screen-effects-debug-status div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
}

.screen-effects-debug-status dt {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.screen-effects-debug-status dd {
    margin: 0;
    color: #ffffff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.screen-effects-debug-note {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    line-height: 1.55;
}

.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 {
    line-height: 1;
}

.room-list-update-icon {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.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, minmax(0, 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%;
    min-width: 0;
    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: #1461ff;
}

.warp-room-grid-items .room-list-item:hover {
    transform: none;
    background-color: var(--accent-color-muted);
    border-color: #1461ff;
}

.room-list-item:focus-within { border-color: #1461ff; }

.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 {
    display: block;
    width: 100%;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.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;
    }

    .reaction-menu {
        min-width: min(184px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }

    #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, minmax(0, 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 */

/* Room一覧・ワープ先一覧の共通カタログ。参加者ダイアログには適用しない。 */
.room-catalog-overlay { padding: 0; overflow: hidden; }
.room-catalog {
    --room-catalog-scale: 1;
    width: 1320px; height: 780px; max-width: none; max-height: none; flex: 0 0 auto;
    padding: 32px; border-radius: 34px; background: rgba(0, 0, 0, .87);
    display: flex; flex-direction: column; text-align: left; min-height: 0;
    transform: scale(var(--room-catalog-scale)); transform-origin: center; will-change: transform;
}
.room-catalog .room-list-header { border-bottom: 1px solid #ffffff40; padding-bottom: 12px; margin: 0; flex-shrink: 0; }
.room-catalog .room-list-header h2 { font-size: 20px; }
.room-catalog-tabs-row { position: relative; display: grid; grid-template-columns: 50% max-content 1fr; align-items: start; flex-shrink: 0; margin: 16px 0 24px; }
.room-catalog-tabs { display: contents; }
.room-catalog-tabs button {
    border: 0; border-bottom: 1px solid #ffffff55; background: transparent; color: white;
    font: inherit; font-size: 26px; padding: 16px 0 28px; text-align: left; cursor: pointer;
}
.room-catalog-tabs button[aria-selected="true"] { border-bottom: 4px solid white; font-weight: 700; padding-bottom: 25px; }
/* The meeting label sizes its own column; the independent create action follows it. */
.room-catalog-tabs button[data-room-type="meeting"] { border-bottom-color: transparent; white-space: nowrap; }
.room-catalog-tabs button[data-room-type="meeting"]::after {
    content: ""; position: absolute; left: 50%; right: 0; bottom: 0;
    border-bottom: 1px solid #ffffff55; pointer-events: none;
}
.room-catalog-tabs button[data-room-type="meeting"][aria-selected="true"]::after { border-bottom: 4px solid white; }
.room-catalog-create {
    position: relative; justify-self: start; margin: 14px 0 0 16px; padding: 10px 16px; white-space: nowrap;
    border: 1px solid #ffffff55; border-radius: 30px; background: transparent; color: white;
    font: inherit; font-size: 16px; cursor: pointer;
}
.room-catalog-grid { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 24px; overflow: auto; min-height: 0; padding: 2px; }
.room-catalog-grid.hidden { display: none; }
.room-catalog-card {
    --room-list-normal-image: none; --room-list-hover-image: var(--room-list-normal-image);
    position: relative; display: grid; align-content: start; min-width: 0; min-height: 376px;
    padding: 0 0 140px; border-radius: 30px; overflow: hidden;
    background: #60646a; border: 4px solid transparent;
}
.room-catalog-card::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: var(--room-list-normal-image);
    background-position: center; background-size: cover;
}
.room-catalog-card:hover::before { background-image: var(--room-list-hover-image); }
.room-catalog-card:hover,
.room-catalog-card:focus-within { border-color: #1461ff; }
.room-catalog-select {
    position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
    border: 0; padding: 0; background: transparent; cursor: pointer;
}
.room-catalog-select:disabled { cursor: default; opacity: 1; }
.room-catalog-content {
    position: relative; z-index: 2; min-width: 0; padding: 20px 16px;
    background: rgba(0, 0, 0, .5); pointer-events: none;
}
.room-catalog-content::after {
    content: ''; position: absolute; top: 100%; right: 0; left: 0; height: 48px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent);
    pointer-events: none;
}
.room-catalog-name,
.room-catalog-creator,
.room-catalog-date,
.room-catalog-description { position: relative; display: block; color: white; line-height: 1.6; pointer-events: none; }
.room-catalog-name { width: 100%; min-width: 0; font-size: 20px; font-weight: 700; margin: 0 0 10px; white-space: nowrap; }
.room-catalog-creator { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-catalog-creator, .room-catalog-date { font-size: 16px; color: #ffffffbd; }
.room-catalog-description { margin-top: 8px; font-size: 17px; overflow-wrap: anywhere; white-space: normal; }
.room-catalog-users {
    position: relative; z-index: 3; justify-self: start; display: inline-flex; align-items: center; gap: 4px;
    margin-top: 8px; border: 0; padding: 0; background: transparent; color: #ffffffbd;
    font: inherit; font-size: 14px; cursor: pointer; pointer-events: auto;
}
.room-catalog-users img { width: 14px; height: 14px; }
.room-catalog button:focus-visible { outline: 3px solid #76a7ff; outline-offset: -3px; }
.room-catalog .room-list-feedback { flex-shrink: 0; margin: 0 0 12px; }
.room-catalog-empty-image,
.room-catalog-empty-create { display: none; }
.room-catalog-empty-message { margin: 0; }
.room-catalog-empty.is-meeting:not(.hidden) {
    flex: 1; min-height: 0; margin: 0; display: grid;
    grid-template-rows: minmax(0, min(320px, 60%)) auto auto;
    align-content: center; justify-items: center;
    gap: 24px; text-align: center;
}
.room-catalog-empty.is-meeting .room-catalog-empty-image {
    display: block; align-self: center; width: min(320px, 55%); height: 100%; min-height: 0;
    max-height: 320px; object-fit: contain;
}
.room-catalog-empty.is-meeting .room-catalog-empty-create {
    display: block; width: min(408px, 80%); padding: 16px 24px;
    border: 0; border-radius: 999px;
    background: #0f62fe; color: white; font: inherit; font-weight: 700; cursor: pointer;
}
.room-catalog-empty.is-meeting .room-catalog-empty-create:hover { background: #0353e9; }
#create-meeting-room-dialog { z-index: 1100; }
#meeting-room-description-input { resize: vertical; min-height: 74px; }
#meeting-room-description-count { font-size: 13px; color: #ffffffbd; }
.room-catalog-select > span { flex-shrink: 0; }
#meeting-room-config-retry.hidden { display: none; }

/* Meeting creation: reference layout, scoped to this dialog. */
#create-meeting-room-dialog { background: rgba(4, 8, 12, .56); backdrop-filter: none; padding: 0; overflow: hidden; }
#create-meeting-room-dialog .meeting-create-card { width: 610px; max-width: none; flex-shrink: 0; box-sizing: border-box; padding: 32px; border: 0; border-radius: 36px; background: rgba(0, 0, 0, .88); text-align: left; transform: scale(var(--meeting-create-scale, 1)); transform-origin: center; }
.meeting-create-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; margin-bottom: 24px; border-bottom: 1px solid #ffffff30; }
#create-meeting-room-dialog h2 { font-size: 18px; margin: 0; }
.meeting-create-header .chat-close-button { width: 32px; height: 32px; }
.meeting-create-header img { width: 16px; height: 16px; }
#create-meeting-room-dialog .name-input-group { width: 100%; margin: 0 0 24px; gap: 16px; }
#create-meeting-room-dialog label, .meeting-color-field legend { color: white; font-size: 16px; font-weight: 700; }
#create-meeting-room-dialog .name-input { width: 100%; box-sizing: border-box; padding: 16px; border: 1px solid #ffffff40; border-radius: 17px; background: transparent; color: white; font-size: 14px; }
#create-meeting-room-dialog .name-input::placeholder { color: #ffffffbd; }
#meeting-room-description-count { margin-top: -10px; }
.meeting-create-options { display: grid; grid-template-columns: 178px 1fr; gap: 32px; align-items: start; }
.meeting-capacity-control { height: 56px; display: flex; align-items: center; border: 1px solid #ffffff40; border-radius: 17px; padding: 0 12px; }
.meeting-capacity-control input { width: 100%; min-width: 0; border: 0; background: transparent; color: white; font-size: 14px; appearance: textfield; }
.meeting-capacity-control input::-webkit-inner-spin-button, .meeting-capacity-control input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.meeting-capacity-control button { border: 0; background: transparent; color: white; width: 28px; height: 40px; flex-shrink: 0; cursor: pointer; }
.meeting-capacity-control span { color: #ffffff80; }
.meeting-color-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.meeting-color-field legend { padding: 0; margin-bottom: 26px; }
.meeting-color-options { display: flex; justify-content: space-between; gap: 12px; }
.meeting-color-options button { width: 36px; height: 36px; flex-shrink: 0; border: 2px solid transparent; border-radius: 50%; background: var(--swatch-color); cursor: pointer; }
.meeting-color-options button[aria-pressed="true"] { border-color: white; }
#create-meeting-room-dialog button:focus-visible, #create-meeting-room-dialog input:focus-visible, #create-meeting-room-dialog textarea:focus-visible { outline: 2px solid white; outline-offset: 3px; }
#create-meeting-room-dialog .dialog-actions { gap: 24px; margin-top: 8px; }
#create-meeting-room-dialog .dialog-actions button { width: 128px; height: 64px; padding: 14px 12px; flex-shrink: 0; white-space: nowrap; border-radius: 32px; font-size: 16px; font-weight: 700; }
#create-meeting-room-dialog .secondary-button { background: transparent; border: 1px solid #ffffff40; }
#create-meeting-room-dialog .primary-button { background: #0960ff; border: 1px solid #ffffff30; }
