/* ═══════════════════════════════════════════
   LV GAME HUB — Auth Widget [lv_auth]
   ═══════════════════════════════════════════ */

/* ── Container ── */
#lv-auth-widget {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    position: relative;
}

/* ── Logged-out: buttons ── */
.lvgh-widget-btn {
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    white-space: nowrap;
}
.lvgh-widget-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.lvgh-widget-btn-outline:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}
.lvgh-widget-btn-primary {
    background: linear-gradient(135deg, #3a8f3d, #2d7a30);
    color: #fff;
    border: none;
    box-shadow: 0 2px 12px var(--accent-green-glow);
}
.lvgh-widget-btn-primary:hover {
    box-shadow: 0 4px 20px var(--accent-green-glow);
    transform: translateY(-1px);
}

/* ── Logged-in: user trigger ── */
.lvgh-widget-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: var(--transition);
    user-select: none;
}
.lvgh-widget-user:hover {
    border-color: var(--accent-green);
    background: var(--bg-card-hover);
}
.lvgh-widget-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.lvgh-widget-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.lvgh-widget-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.lvgh-widget-pts {
    font-size: 11px;
    color: var(--accent-gold);
    font-family: var(--font-mono);
}
.lvgh-widget-chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.lvgh-widget-user.open .lvgh-widget-chevron {
    transform: rotate(180deg);
}

/* ── Dropdown ── */
.lvgh-widget-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 9999;
    overflow: hidden;
    animation: lvghDdFadeIn 0.15s ease-out;
}
@keyframes lvghDdFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lvgh-widget-dropdown-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.lvgh-widget-dropdown-row span:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.lvgh-widget-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.lvgh-widget-dropdown-btn {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}
.lvgh-widget-dropdown-btn:hover {
    background: var(--bg-card-hover);
}
.lvgh-widget-dropdown-btn.primary {
    color: var(--accent-green);
}
.lvgh-widget-dropdown-btn.primary:hover {
    background: rgba(76, 175, 80, 0.08);
}
.lvgh-widget-dropdown-btn.danger {
    color: var(--accent-red);
}
.lvgh-widget-dropdown-btn.danger:hover {
    background: rgba(231, 76, 60, 0.08);
}

/* ── Auth Modal Overlay ── */
.lvgh-auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ── Auth Modal Card ── */
.lvgh-auth-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px 28px;
    width: 100%;
    max-width: 380px;
    position: relative;
    animation: lvghModalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes lvghModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.lvgh-auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    line-height: 1;
}
.lvgh-auth-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.lvgh-auth-logo-sm {
    font-size: 36px;
    text-align: center;
    margin-bottom: 8px;
    animation: lvghFloat 3s ease-in-out infinite;
}
@keyframes lvghFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.lvgh-auth-modal-title {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.lvgh-auth-modal-sub {
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

.lvgh-auth-modal-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 13px;
    margin-bottom: 14px;
    animation: lvghShake 0.3s ease;
}
@keyframes lvghShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}

.lvgh-auth-modal-field {
    margin-bottom: 14px;
}
.lvgh-auth-modal-field label {
    display: block;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.lvgh-auth-modal-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}
.lvgh-auth-modal-field input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-glow);
}
.lvgh-auth-modal-field input::placeholder {
    color: var(--text-muted);
}

.lvgh-auth-modal-submit {
    width: 100%;
    padding: 14px;
    margin-top: 4px;
    background: linear-gradient(135deg, #3a8f3d, #2d7a30);
    color: #fff;
    border: none;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px var(--accent-green-glow);
}
.lvgh-auth-modal-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-green-glow);
}
.lvgh-auth-modal-submit:active  { transform: translateY(0); }
.lvgh-auth-modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.lvgh-auth-modal-switch {
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
    margin-bottom: 0;
}
.lvgh-auth-modal-switch a {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 600;
}
.lvgh-auth-modal-switch a:hover {
    text-decoration: underline;
}

/* ── Verification / reset code input ── */
.lvgh-auth-modal-field input.lvgh-code-input {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 10px;
    padding-left: 10px; /* visually compensate letter-spacing on the last char */
}
.lvgh-auth-modal-field input.lvgh-code-input::placeholder {
    letter-spacing: 6px;
    font-size: 18px;
}
