/* ─── ロビー／アバター設定 ─── */
/* 1600:1000 の固定比率フレームを画面内へ contain し、全要素を相似拡縮する。 */

.lobby-screen {
    display: block;
    padding: 0;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
}

.lobby-layout-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(100vw, 160vh);
    height: min(100vh, 62.5vw);
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-rows: 13% 87%;
    pointer-events: none;
}

.lobby-header {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lobby-header h1 {
    color: rgba(255, 255, 255, 0.94);
    font-size: min(1.8vw, 2.88vh);
    letter-spacing: 0.02em;
}

.lobby-main-layout {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 32% 35% 33%;
    padding: 2% 4% 3% 5.8%;
    pointer-events: none;
}

.lobby-left-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: min(8.2vw, 13.12vh);
    pointer-events: none;
}

.lobby-avatar-picker,
.lobby-profile-panel,
.lobby-language-switch,
.lobby-avatar-viewport {
    pointer-events: auto;
}

.lobby-avatar-picker {
    width: 100%;
    margin-left: 4%;
}

.lobby-avatar-preset-list {
    display: grid;
    grid-template-columns: repeat(3, 26.6%);
    gap: min(1.2vw, 1.92vh);
}

.lobby-avatar-preset-list .avatar-editor-preset-item {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    padding: min(0.2vw, 0.32vh);
    border-width: min(0.15vw, 0.24vh);
}

.lobby-avatar-preset-list .avatar-editor-preset-item.selected {
    border-color: var(--accent-color-hover);
}

.lobby-avatar-preset-list .avatar-editor-preset-thumb {
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.04);
}

.lobby-avatar-viewport {
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    cursor: grab;
    touch-action: none;
    outline: none;
}

.lobby-avatar-viewport:active {
    cursor: grabbing;
}

.lobby-avatar-viewport:focus-visible {
    outline: none;
}

.lobby-profile-panel {
    grid-column: 3;
    width: 84%;
    margin: 0;
    align-self: center;
    justify-self: end;
}

.lobby-name-row {
    display: flex;
    align-items: center;
    gap: min(0.7vw, 1.12vh);
    padding-bottom: min(0.6vw, 0.96vh);
    border-bottom: min(0.1vw, 0.16vh) solid rgba(255, 255, 255, 0.62);
    transition: border-color 0.15s ease;
}

.lobby-name-row:has(.lobby-name-input:focus) {
    border-bottom-color: var(--accent-color-hover);
}

.lobby-name-input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #ffffff;
    font-size: min(1.4vw, 2.24vh);
    font-weight: 600;
}

.lobby-name-input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

/* ブラウザの入力履歴／オートフィル選択後もロビーの配色を維持する。 */
.lobby-name-input:is(:-webkit-autofill, :autofill),
.lobby-name-input:is(:-webkit-autofill, :autofill):hover,
.lobby-name-input:is(:-webkit-autofill, :autofill):focus,
.lobby-name-input:is(:-webkit-autofill, :autofill):active {
    appearance: none;
    color: #ffffff;
    caret-color: #ffffff;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background-color: transparent !important;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    transition: background-color 9999s ease-out 0s;
}

.lobby-start-button {
    width: min(3vw, 4.8vh);
    height: min(3vw, 4.8vh);
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.lobby-start-button img {
    display: block;
    width: min(1.1vw, 1.76vh);
    height: min(1.1vw, 1.76vh);
}

.lobby-start-button:hover,
.lobby-start-button:focus-visible,
.lobby-name-input:focus + .lobby-start-button,
.lobby-name-input:not(:placeholder-shown) + .lobby-start-button {
    background: var(--accent-color-hover);
}

.lobby-start-button:hover,
.lobby-start-button:focus-visible {
    transform: translateX(2px);
    outline: none;
}

.lobby-avatar-customization {
    margin-top: min(1.5vw, 2.4vh);
}

.lobby-avatar-customization .avatar-editor-custom-row,
.lobby-avatar-customization .avatar-editor-custom-row:last-child {
    min-height: min(5.5vw, 8.8vh);
    padding-block: min(1.25vw, 2vh);
    border-bottom: 0;
}

.lobby-avatar-customization .avatar-editor-custom-row.unavailable {
    display: none;
}

.lobby-avatar-customization .avatar-editor-custom-row-left {
    gap: 10px;
}

.lobby-avatar-customization .avatar-editor-custom-icon {
    width: min(1.4vw, 2.24vh);
    height: min(1.4vw, 2.24vh);
    background: transparent;
}

.lobby-avatar-customization .avatar-editor-custom-label {
    color: rgba(255, 255, 255, 0.44);
    font-size: min(1vw, 1.6vh);
}

.lobby-avatar-customization .avatar-editor-swatches {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: min(0.5vw, 0.8vh);
    max-width: 68%;
}

.lobby-avatar-customization .avatar-editor-swatch {
    width: min(3vw, 4.8vh);
    height: min(3vw, 4.8vh);
}

.lobby-avatar-customization .avatar-editor-swatch.selected {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7), 0 0 0 3px var(--accent-color-hover);
}

.lobby-language-switch {
    width: 100%;
    margin-top: auto;
    display: flex;
    gap: 3%;
}

.lobby-language-button {
    width: 47%;
    min-width: 0;
    padding: min(1.05vw, 1.68vh) min(1.4vw, 2.24vh);
    border: min(0.1vw, 0.16vh) solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: min(1.2vw, 1.92vh);
    cursor: pointer;
}

.lobby-language-button.active {
    border-color: var(--accent-color-hover);
    color: #ffffff;
}
