.xzb-game-root {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.xzb-game-menu {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* Canvas 做背景层 */
#menu-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 菜单 UI 在上层 */
.menu-ui {
    position: relative;
    z-index: 1;
}

.xzb-game-playground {
    position: relative;
    width: 100%;
    height: 100%;
    user-select: none;
}
.xzb-game-settings {
    position: relative;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    background: radial-gradient(circle at 20% 10%, #1e3b55 0%, #0a1220 45%, #05080f 100%);
    padding: 24px;
    overflow-y: auto;
}

.xzb-hidden {
    /* 必须压过后续组件的 display 规则（如 .xzb-overlay 的 flex） */
    display: none !important;
}

.xzb-panel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: #e8f3ff;
    font-size: 28px;
    letter-spacing: 1px;
    /* 不拦截画布点击，保证移动指令能传到 playground 容器 */
    pointer-events: none;
}

.xzb-btn {
    padding: 10px 22px;
    border: 1px solid rgba(120, 200, 255, 0.6);
    background: rgba(8, 20, 35, 0.6);
    color: #e8f3ff;
    cursor: pointer;
    transition: all 0.2s ease;
    /* 按钮仍可点击 */
    pointer-events: auto;
}

.xzb-btn:hover {
    border-color: rgba(120, 200, 255, 1);
    background: rgba(8, 20, 35, 0.85);
    transform: scale(1, 1.5);
}

.xzb-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}

.overlay-card {
    min-width: 320px;
    padding: 24px;
    border: 1px solid rgba(120, 200, 255, 0.45);
    background: rgba(6, 16, 30, 0.92);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.overlay-title {
    color: #e8f3ff;
    font-size: 24px;
    margin-bottom: 4px;
}

.config-card {
    min-width: 420px;
    align-items: stretch;
}

.config-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #cfe8ff;
    font-size: 14px;
}

.config-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(120, 200, 255, 0.45);
    background: rgba(3, 12, 24, 0.9);
    color: #e8f3ff;
    outline: none;
}

.config-input:focus {
    border-color: rgba(120, 200, 255, 0.95);
}

.settings-shell {
    width: min(980px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-alert {
    border: 2px solid #ff6b6b;
    background: rgba(255, 55, 55, 0.18);
    color: #ffdada;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
}

.settings-alert-error {
    border-color: #ff5858;
    background: rgba(255, 55, 55, 0.18);
    color: #ffe2e2;
}

.settings-alert-success {
    border-color: #44d07f;
    background: rgba(34, 185, 103, 0.2);
    color: #dcffe9;
}

.settings-title {
    color: #f0f7ff;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 1px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.settings-card {
    border: 1px solid rgba(120, 200, 255, 0.35);
    background: rgba(8, 20, 35, 0.78);
    padding: 16px;
    color: #d8e9ff;
}

.settings-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #eff7ff;
}

.settings-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.settings-label {
    font-size: 14px;
    color: #cfe4ff;
}

.settings-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(120, 200, 255, 0.45);
    background: rgba(3, 12, 24, 0.9);
    color: #e8f3ff;
    outline: none;
}

.settings-input:focus {
    border-color: rgba(120, 200, 255, 0.95);
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-tip {
    margin-top: 12px;
    min-height: 20px;
    font-size: 13px;
    color: #b8d5f8;
}

.settings-avatar-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.settings-avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid rgba(120, 200, 255, 0.75);
    background: rgba(4, 14, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.settings-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-letter {
    color: #f4fbff;
    font-size: 38px;
    font-weight: 700;
}

.settings-avatar-meta {
    flex: 1;
}

.settings-avatar-input {
    display: none;
}

.settings-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-avatar-history-wrap {
    margin-top: 12px;
}

.settings-avatar-history-title {
    font-size: 13px;
    color: #c7def9;
    margin-bottom: 8px;
}

.settings-avatar-history {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-avatar-history-empty {
    font-size: 13px;
    color: #b8d5f8;
}

.settings-avatar-history-item {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(120, 200, 255, 0.45);
    background: rgba(3, 12, 24, 0.9);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}

.settings-avatar-history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-history-item-active {
    border-color: rgba(120, 200, 255, 1);
    box-shadow: 0 0 0 2px rgba(120, 200, 255, 0.35);
}

.settings-intro-card {
    line-height: 1.6;
}

.settings-intro-text {
    margin: 0;
    color: #d7eaff;
    font-size: 15px;
}

@media (max-width: 900px) {
    .xzb-game-settings {
        padding: 16px;
    }

    .settings-title {
        font-size: 28px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}
