#loading-screen,
#login-screen,
#username-screen,
#welcome-screen {
    text-align: center;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/homepage.png');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.auth-box {
    background: rgba(0, 0, 0, 0.6);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    width: 80%;
    max-width: 400px;
}

/* --- Alias Board (wanted-poster style) --- */
.alias-board {
    position: relative;
    width: 92%;
    max-width: 380px;
    background:
        url('https://www.transparenttextures.com/patterns/old-map.png'),
        linear-gradient(175deg, #d4b483 0%, #c4a265 30%, #b8934a 70%, #a07d3a 100%);
    border: 6px solid #5d3a1a;
    border-radius: 4px;
    box-shadow:
        0 0 0 2px #3e2210,
        0 0 0 5px rgba(93, 58, 26, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.7),
        inset 0 0 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.alias-header {
    position: relative;
    padding: 20px 20px 14px;
    text-align: center;
    border-bottom: 3px solid #5d3a1a;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 48px,
            rgba(0,0,0,0.03) 48px,
            rgba(0,0,0,0.03) 50px
        ),
        linear-gradient(180deg, rgba(0,0,0,0.05) 0%, transparent 40%, rgba(0,0,0,0.08) 100%);
}

.alias-nail {
    position: absolute;
    top: 10px;
    width: 14px; height: 14px;
    background: radial-gradient(circle at 40% 35%, #aaa 0%, #666 50%, #444 100%);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.3);
}
.alias-nail-left  { left: 14px; }
.alias-nail-right { right: 14px; }

.alias-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2px;
}

.alias-star {
    font-size: 22px;
    color: #5d3a1a;
    text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

.alias-title {
    font-family: 'BJ Cree', serif;
    font-size: 24px;
    color: #2c1507;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
    line-height: 1.2;
}

.alias-subtitle {
    font-family: 'Georgia', serif;
    font-size: 10px;
    color: #6b4c2a;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 8px 0 0;
    font-weight: bold;
    font-style: italic;
}

.alias-body {
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#username-screen #username-input {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-family: 'BJ Cree', serif;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(93, 58, 26, 0.4);
    border-radius: 4px;
    color: #2c1507;
    text-align: center;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

#username-screen #username-input::placeholder {
    color: #8a7050;
    font-style: italic;
}

#username-screen #username-input:focus {
    border-color: #5d3a1a;
    background: rgba(255, 255, 255, 0.22);
}

.alias-confirm-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(180deg, #5d3a1a 0%, #3e2210 100%) !important;
    color: #d4b483 !important;
    font-family: 'BJ Cree', serif;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid #8b6914 !important;
    border-radius: 4px !important;
    cursor: pointer;
    box-shadow: 0 3px 0 #2c1507, 0 4px 8px rgba(0,0,0,0.3) !important;
    transition: transform 0.1s, box-shadow 0.1s;
}

.alias-confirm-btn:active {
    transform: translateY(3px) !important;
    box-shadow: 0 0 0 #2c1507, 0 1px 4px rgba(0,0,0,0.3) !important;
}

/* --- Welcome / Tutorial Screen --- */
#welcome-screen {
    text-align: center;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.welcome-body {
    gap: 12px;
}

.welcome-text {
    font-family: 'Georgia', serif;
    font-size: 14px;
    color: #3e2210;
    margin: 0 0 4px;
    line-height: 1.4;
}

.welcome-tutorial-btn {
    text-align: center;
    text-decoration: none;
}

.welcome-skip-btn {
    background: transparent;
    color: #6b4c2a;
    border: 1px solid #6b4c2a;
    padding: 10px;
    width: 100%;
    font-family: 'Georgia', serif;
    font-size: 13px;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.welcome-skip-btn:active {
    opacity: 0.6;
}

#login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 15px;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 30px;
    background: #fff;
    color: #444;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    width: 100%;
    border: none;
    cursor: pointer;
}

#skip-login-btn {
    background: transparent;
    color: #aaa;
    border: 1px solid #aaa;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

#username-input {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #555;
    border-radius: 10px;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #eee;
    border-top: 5px solid #e67e22;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}