.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;
    overflow: hidden;
}

/* ─── Alpha badge ribbon (top-right diagonal) ─── */
.alpha-badge {
    position: absolute;
    top: 40px;
    right: -60px;
    width: 280px;
    padding: 10px 0;
    background: #cc2222;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    transform: rotate(35deg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 600;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
}

.auth-switch-link {
    color: #daa520;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch-link:hover {
    color: #f0c060;
    text-decoration: underline;
}

.auth-disclaimer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 8px;
}

.auth-disclaimer-title {
    font-size: 11px;
    font-weight: 600;
    color: #daa520;
    margin-bottom: 2px;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-check input[type="checkbox"] {
    accent-color: #daa520;
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-check span {
    user-select: none;
}

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

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