.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgb(10, 10, 20);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

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

.auth-logo {
    max-width: 320px;
    height: auto;
    margin-bottom: 24px;
}

.auth-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    padding: 36px 40px;
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-title);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-main);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--slot-border);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
    border-color: var(--text-title);
    box-shadow: 0 0 8px rgba(232, 162, 58, 0.15);
}

.auth-input::placeholder {
    color: var(--text-dim);
}

.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-buttons .btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
}

.auth-error {
    color: var(--bar-hp);
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

/* ─── Character creation ─── */
.character-creation-panel {
    width: 380px;
    align-items: center;
}

.character-creation-panel.hidden {
    display: none;
}

.model-preview-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#model-preview-canvas {
    width: 280px;
    height: 320px;
    border: 1px solid var(--slot-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.model-select-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.model-select-buttons .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-name-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-title);
    min-width: 100px;
    text-align: center;
}

.auth-btn-create {
    width: 100%;
}

@media (max-width: 600px) {
    .auth-panel {
        width: calc(100vw - 32px);
        max-width: 340px;
        padding: 28px 24px;
    }
    .character-creation-panel {
        max-width: 380px;
    }
}

/* ─── Loading screen ─── */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgb(10, 10, 20);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

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

.loading-logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 32px;
}

.loading-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.loading-bar-track {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bar-progress), #f0c060);
    border-radius: 4px;
    transition: width 0.3s ease-out;
}

.loading-details {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-dim);
    min-height: 16px;
}

@media (max-width: 600px) {
    .loading-bar-track {
        width: calc(100vw - 64px);
        max-width: 300px;
    }
}
