* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --card-bg: #000000;
    --gamertag-bg: #25282c;
    --presence-green: #32A460;
    --focus-ring: rgba(255, 255, 255, 0.98);
}

body {
    min-height: 100vh;
    font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
    background: #000;
    color: var(--text-primary);
}

.viewport {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

/* Prototype Container (1920x1080 @ 16:9) */
.prototype {
    position: relative;
    width: min(96vw, calc(96vh * 16 / 9));
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

/* Background */
.background-layer {
    position: absolute;
    inset: -22px;
    z-index: 0;
    overflow: hidden;
}

.bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(22px);
}

.bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
}

/* Center Content (Xbox card + Profile card stacked) */
.center-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(567 / 1920 * 100%);
    gap: 8px;
    z-index: 10;
}

.center-content.no-xbox-card {
    margin-top: 0;
}

/* Xbox Card */
.xbox-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}

.xbox-card.hidden {
    visibility: hidden;
    pointer-events: none;
}

.xbox-card-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: calc(10 / 1920 * 100vw);
    background: #141416;
    border-radius: 100px;
    padding: calc(20 / 1920 * 100vw) calc(28 / 1920 * 100vw);
}

.xbox-logo-icon {
    width: calc(26 / 1920 * 100vw);
    height: calc(26 / 1920 * 100vw);
    min-width: 13px;
    min-height: 13px;
    flex-shrink: 0;
}

.xbox-card-status {
    font-size: clamp(0.6rem, calc(20 / 1920 * 100vw), 1.25rem);
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
}

.xbox-card-status strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* Gamertag row */
.xbox-card-profile {
    background: transparent;
    border-radius: calc(10 / 1920 * 100vw);
    padding: calc(7 / 1920 * 100vw);
    display: flex;
    align-items: center;
    gap: calc(12 / 1920 * 100vw);
    position: relative;
}

.xbox-card-profile.mismatch {
    align-items: center;
}

.gamerpic-wrapper {
    position: relative;
    width: calc(40 / 1920 * 100vw);
    height: calc(40 / 1920 * 100vw);
    min-width: 20px;
    min-height: 20px;
    flex-shrink: 0;
}

.gamerpic-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.presence-badge {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: calc(12 / 1920 * 100vw);
    height: calc(12 / 1920 * 100vw);
    min-width: 7px;
    min-height: 7px;
    background: var(--presence-green);
    border-radius: 50%;
    border: 1.5px solid var(--gamertag-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.presence-badge svg {
    width: 70%;
    height: 70%;
}

.presence-badge.offline {
    background: rgba(255, 255, 255, 0.4);
}

.presence-badge.hidden {
    display: none;
}

.gamertag-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.gamertag-row {
    display: flex;
    align-items: baseline;
    gap: calc(8 / 1920 * 100vw);
    min-width: 0;
}

.gamertag-label {
    font-size: clamp(0.6rem, calc(18 / 1920 * 100vw), 1.2rem);
    font-weight: 700;
    line-height: 1.22;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gamertag-real-name {
    font-size: clamp(0.6rem, calc(18 / 1920 * 100vw), 1.2rem);
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.warning-icon {
    position: absolute;
    top: calc(7 / 1920 * 100vw);
    right: calc(7 / 1920 * 100vw);
    width: calc(20 / 1920 * 100vw);
    height: calc(20 / 1920 * 100vw);
    min-width: 12px;
    min-height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-icon svg {
    width: 100%;
    height: 100%;
}

/* Tooltip pointer below card — downward triangle */
.xbox-card-pointer {
    width: calc(36 / 1920 * 100vw);
    height: calc(12 / 1920 * 100vw);
    min-width: 18px;
    min-height: 6px;
    margin-top: -1px;
    position: relative;
    z-index: -1;
    line-height: 0;
}
.xbox-card-pointer svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Profile Card */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.active-avatar {
    width: calc(220 / 1920 * 100vw);
    height: calc(220 / 1920 * 100vw);
    min-width: 100px;
    min-height: 100px;
    border-radius: 50%;
    margin-bottom: calc(20 / 1080 * 100vh);
    position: relative;
    overflow: hidden;
    will-change: transform, opacity;
}

.active-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.12);
}

.active-avatar:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-ring),
                0 0 14px rgba(255, 255, 255, 0.55),
                0 0 26px rgba(255, 255, 255, 0.28);
}

.active-avatar:focus-visible img {
    box-shadow: none;
}

.profile-card h2 {
    font-size: clamp(1.2rem, calc(40 / 1920 * 100vw), 2.8rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    text-align: center;
}

.account-email {
    margin-top: calc(16 / 1080 * 100vh);
    font-size: clamp(0.65rem, calc(20 / 1920 * 100vw), 1.3rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-primary);
    text-align: center;
}

/* Account Picker */
.account-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.side-account {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: calc(44 / 1920 * 100vw);
    pointer-events: all;
}

.side-left {
    left: calc(58 / 1920 * 100%);
}

.side-right {
    right: calc(58 / 1920 * 100%);
}

.chevron {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    opacity: 0;
    pointer-events: none;
}

.chevron svg {
    width: calc(25 / 1920 * 100vw);
    height: calc(50 / 1080 * 100vh);
    min-width: 11px;
    min-height: 22px;
}

.chevron:hover {
    opacity: 0.85;
}

.chevron.dim {
    opacity: 0.20;
    cursor: default;
    pointer-events: none;
}

.preview-account {
    position: relative;
    width: calc(80 / 1920 * 100vw);
    height: calc(80 / 1920 * 100vw);
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0.65;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.preview-account:hover {
    opacity: 0.85;
}

.preview-account.hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Subtle depth on side circles — scale only to keep circles round */
.side-left .preview-account {
    transform: scale(0.92);
}

.side-right .preview-account {
    transform: scale(0.92);
}

.preview-account img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, calc(40 / 1920 * 100vw), 2.5rem);
    font-weight: 600;
    color: var(--text-primary);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Bottom Icon Bar */
.bottom-icons {
    position: absolute;
    bottom: calc(16 / 1080 * 100%);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.bottom-icons-row {
    display: flex;
    align-items: center;
    gap: calc(16 / 1920 * 100vw);
}

.icon-button {
    width: calc(64 / 1920 * 100vw);
    height: calc(64 / 1920 * 100vw);
    min-width: 28px;
    min-height: 28px;
    background: transparent;
    border: none;
    border-radius: calc(4 / 1920 * 100vw);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    overflow: hidden;
}

.icon-button svg {
    width: 50%;
    height: 50%;
    flex-shrink: 0;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.icon-accessibility {
    background: transparent;
}

.icon-wifi {
    border-radius: calc(24 / 1920 * 100vw);
    background: transparent;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

/* Focus styles: one moving ring on the currently focused element */
button:focus-visible,
[tabindex="0"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-ring),
                0 0 12px rgba(255, 255, 255, 0.5),
                0 0 22px rgba(255, 255, 255, 0.22);
}

.icon-button:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

/* ── Virtual PIN Keyboard ── */

/* PIN Entry Area (above keyboard, in center content) */
.pin-entry {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: calc(16 / 1080 * 100vh);
}

.prototype.pin-open .pin-entry {
    display: flex;
}

.pin-edit-btn {
    width: calc(85 / 1920 * 100vw);
    height: calc(85 / 1920 * 100vw);
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-bottom: calc(8 / 1080 * 100vh);
}

.pin-edit-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.pin-edit-btn svg {
    width: 50%;
    height: 50%;
}

.pin-dots-container {
    width: calc(280 / 1920 * 100vw);
    min-width: 150px;
    height: calc(68 / 1080 * 100vh);
    min-height: 36px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: calc(20 / 1920 * 100vw);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-dots {
    display: flex;
    gap: calc(20 / 1920 * 100vw);
}

.pin-dot {
    width: calc(18 / 1920 * 100vw);
    height: calc(18 / 1920 * 100vw);
    min-width: 10px;
    min-height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    transition: background 0.15s, border-color 0.15s;
}

.pin-dot.filled {
    background: white;
    border-color: white;
}

.pin-forgot {
    font-size: clamp(0.55rem, calc(16 / 1920 * 100vw), 1rem);
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
}

.pin-forgot:hover {
    text-decoration: underline;
}

/* Sign-in options */
.pin-sign-in-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(12 / 1080 * 100vh);
    margin-top: calc(8 / 1080 * 100vh);
}

.pin-sign-in-icons {
    display: flex;
    gap: calc(12 / 1920 * 100vw);
}

.pin-option-icon {
    width: calc(48 / 1920 * 100vw);
    height: calc(48 / 1920 * 100vw);
    min-width: 28px;
    min-height: 28px;
    border-radius: calc(12 / 1920 * 100vw);
    background: rgba(255, 255, 255, 0.10);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pin-option-icon:hover {
    background: rgba(255, 255, 255, 0.18);
}

.pin-option-icon.active {
    background: rgba(255, 255, 255, 0.25);
}

.pin-option-icon svg {
    width: 50%;
    height: 50%;
}

.pin-sign-in-label {
    font-size: clamp(0.6rem, calc(20 / 1920 * 100vw), 1.3rem);
    font-weight: 400;
    color: var(--text-primary);
}

/* Docked Keyboard Panel */
.pin-keyboard {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: calc(370 / 1080 * 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #202020;
    border-top-left-radius: calc(4 / 1920 * 100vw);
    border-top-right-radius: calc(4 / 1920 * 100vw);
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

.pin-keyboard.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Toolbar / Candidate bar */
.pin-toolbar {
    width: 100%;
    height: calc(44 / 370 * 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 calc(12 / 1920 * 100vw);
    flex-shrink: 0;
}

.pin-close {
    width: calc(37 / 1920 * 100vw);
    height: calc(37 / 1920 * 100vw);
    min-width: 22px;
    min-height: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: calc(4 / 1920 * 100vw);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.pin-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pin-close svg {
    width: 40%;
    height: 40%;
}

.pin-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* Number pad grid */
.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, calc(85 / 1920 * 100vw));
    grid-template-rows: repeat(4, calc(70 / 1080 * 100vh));
    gap: calc(6 / 1920 * 100vw) calc(7 / 1080 * 100vh);
    flex: 1;
    align-content: center;
    justify-content: center;
}

.pin-key {
    border: none;
    border-radius: calc(4 / 1920 * 100vw);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
    font-size: clamp(0.9rem, calc(25 / 1920 * 100vw), 1.625rem);
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
    min-width: 44px;
    min-height: 36px;
}

.pin-key:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pin-key:active {
    background: rgba(255, 255, 255, 0.20);
}

.pin-key-eye,
.pin-key-backspace {
    background: rgba(255, 255, 255, 0.04);
}

.pin-key-eye:hover,
.pin-key-backspace:hover {
    background: rgba(255, 255, 255, 0.10);
}

.pin-key-eye.active {
    background: rgba(96, 205, 255, 0.25);
}

.pin-key-eye svg,
.pin-key-backspace svg {
    width: 50%;
    height: 50%;
}

/* When keyboard is open, center content above keyboard and hide side nav + bottom icons */
.prototype.pin-open .center-content {
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    top: calc((100% - 370 / 1080 * 100%) / 2);
    transform: translate(-50%, -50%);
}

.prototype.pin-open .account-picker {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.prototype.pin-open .bottom-icons {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* Hide xbox card and show PIN entry when keyboard is open */
.prototype.pin-open .xbox-card {
    display: none;
}

.prototype.pin-open .xbox-card-pointer {
    display: none;
}

/* ── Mode 2: Windows-Hero (inverted layout) ── */
.prototype.win-hero .xbox-card,
.prototype.win-hero .profile-card {
    display: none;
}

.win-hero {
    flex-direction: column;
    align-items: center;
}

/* ── Mode 3: Xbox-Hero (inverted layout) ── */
.prototype.xbox-hero .xbox-card,
.prototype.xbox-hero .profile-card {
    display: none;
}

.xbox-hero {
    flex-direction: column;
    align-items: center;
}

/* Large gamerpic */
.xbox-hero-avatar {
    width: calc(250 / 1920 * 100vw);
    height: calc(250 / 1920 * 100vw);
    min-width: 110px;
    min-height: 110px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    margin-bottom: calc(14 / 1080 * 100vh);
}

.xbox-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.12);
}

.xbox-hero-avatar:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-ring),
                0 0 14px rgba(255, 255, 255, 0.55),
                0 0 26px rgba(255, 255, 255, 0.28);
}

.xbox-hero-avatar:focus-visible img {
    box-shadow: none;
}

.xbox-hero-presence {
    position: absolute;
    bottom: calc(10 / 1920 * 100vw);
    right: calc(10 / 1920 * 100vw);
    width: calc(32 / 1920 * 100vw);
    height: calc(32 / 1920 * 100vw);
    min-width: 18px;
    min-height: 18px;
    background: var(--presence-green);
    border-radius: 50%;
    border: calc(3 / 1920 * 100vw) solid rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.xbox-hero-presence svg {
    width: 55%;
    height: 55%;
}

.xbox-hero-presence.hidden {
    display: none;
}

/* Xbox logo + gamertag row */
.xbox-hero-identity {
    display: flex;
    align-items: center;
    gap: calc(10 / 1920 * 100vw);
    margin-bottom: calc(2 / 1080 * 100vh);
}

.xbox-hero-logo {
    width: calc(30 / 1920 * 100vw);
    height: calc(30 / 1920 * 100vw);
    min-width: 14px;
    min-height: 14px;
    flex-shrink: 0;
}

.xbox-hero-gamertag {
    font-size: clamp(1.2rem, calc(40 / 1920 * 100vw), 2.8rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Online status */
.xbox-hero-status {
    display: flex;
    align-items: center;
    gap: calc(6 / 1920 * 100vw);
    font-size: clamp(0.55rem, calc(16 / 1920 * 100vw), 1rem);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: calc(24 / 1080 * 100vh);
}

.xbox-hero-status-dot {
    width: calc(8 / 1920 * 100vw);
    height: calc(8 / 1920 * 100vw);
    min-width: 5px;
    min-height: 5px;
    background: var(--presence-green);
    border-radius: 50%;
}

/* Windows account pill card */
.xbox-hero-ms-card {
    display: flex;
    align-items: center;
    gap: calc(12 / 1920 * 100vw);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: calc(14 / 1920 * 100vw);
    padding: calc(12 / 1920 * 100vw) calc(18 / 1920 * 100vw);
    min-width: calc(300 / 1920 * 100vw);
}

.xbox-hero-ms-avatar {
    width: calc(40 / 1920 * 100vw);
    height: calc(40 / 1920 * 100vw);
    min-width: 20px;
    min-height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.xbox-hero-ms-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.xbox-hero-ms-name {
    font-size: clamp(0.55rem, calc(16 / 1920 * 100vw), 1rem);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.xbox-hero-ms-email {
    font-size: clamp(0.45rem, calc(13 / 1920 * 100vw), 0.85rem);
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ── Account-switch stagger animation ── */
@keyframes acctFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Center avatar: directional exit ── */
@keyframes centerExitLeft {
    from { opacity: 1; transform: scale(1)   translateX(0); }
    to   { opacity: 0; transform: scale(0.85) translateX(-10vw); }
}
@keyframes centerExitRight {
    from { opacity: 1; transform: scale(1)   translateX(0); }
    to   { opacity: 0; transform: scale(0.85) translateX(10vw); }
}

/* ── Center avatar: enters from the side ── */
@keyframes centerEnterFromRight {
    from { opacity: 0; transform: scale(0.85) translateX(10vw); }
    to   { opacity: 1; transform: scale(1)    translateX(0); }
}
@keyframes centerEnterFromLeft {
    from { opacity: 0; transform: scale(0.85) translateX(-10vw); }
    to   { opacity: 1; transform: scale(1)    translateX(0); }
}

/* Quick fade-out for mode changes (non-directional) */
@keyframes acctFadeOut {
    to { opacity: 0; transform: scale(0.94); }
}

/* Side preview fade-in for init / mode changes */
@keyframes sidePreviewIn {
    from { opacity: 0; }
    to   { opacity: 0.65; }
}

/* Holds center avatar invisible during DOM content swap — prevents 1-frame flash */
.avatar-preparing {
    opacity: 0 !important;
}

.acct-anim {
    animation: acctFadeIn 0.26s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.acct-anim-delay-1 { animation-delay: 0ms; }
.acct-anim-delay-2 { animation-delay: 45ms; }
.acct-anim-delay-3 { animation-delay: 90ms; }
.acct-anim-delay-4 { animation-delay: 140ms; }

/* Directional avatar enter — sweeps in from where the side preview was */
.avatar-enter-right {
    animation: centerEnterFromRight 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}
.avatar-enter-left {
    animation: centerEnterFromLeft 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

/* Outgoing avatar (mode change, no direction) */
.acct-fade-out {
    animation: acctFadeOut 0.18s ease forwards;
    pointer-events: none;
}

/* Directional avatar exit */
.avatar-exit-left {
    animation: centerExitLeft 0.25s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
    pointer-events: none;
}
.avatar-exit-right {
    animation: centerExitRight 0.25s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
    pointer-events: none;
}

/* Text elements fade out gently before content swap */
@keyframes textExit {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-4px); }
}

.text-exit {
    animation: textExit 0.22s ease forwards;
    pointer-events: none;
}

/* Side preview fades in during init / mode changes (not during directional switch) */
.preview-account.preview-incoming {
    animation: sidePreviewIn 0.32s ease both;
}

/* ── 4-position carousel: all 3 circles slide to next position simultaneously ── */

/* EXIT — side preview sliding toward center (grows, drifts inward) */
@keyframes rightPreviewTowardCenter {
    from { opacity: 0.65; transform: scale(0.92) translateX(0); }
    to   { opacity: 0;    transform: scale(1.1)  translateX(-8vw); }
}
@keyframes leftPreviewTowardCenter {
    from { opacity: 0.65; transform: scale(0.92) translateX(0); }
    to   { opacity: 0;    transform: scale(1.1)  translateX(8vw); }
}

/* EXIT — opposite preview receding to back (shrinks away) */
@keyframes leftPreviewToBack {
    from { opacity: 0.65; transform: scale(0.92); }
    to   { opacity: 0;    transform: scale(0.5); }
}
@keyframes rightPreviewToBack {
    from { opacity: 0.65; transform: scale(0.92); }
    to   { opacity: 0;    transform: scale(0.5); }
}

/* ENTER — old center content arriving at side position (shrinks into place) */
@keyframes leftPreviewFromCenter {
    from { opacity: 0;    transform: scale(1.1)  translateX(8vw); }
    to   { opacity: 0.65; transform: scale(0.92) translateX(0); }
}
@keyframes rightPreviewFromCenter {
    from { opacity: 0;    transform: scale(1.1)  translateX(-8vw); }
    to   { opacity: 0.65; transform: scale(0.92) translateX(0); }
}

/* ENTER — new account emerging from behind (grows into side position) */
@keyframes rightPreviewFromBehind {
    from { opacity: 0;    transform: scale(0.5); }
    to   { opacity: 0.65; transform: scale(0.92); }
}
@keyframes leftPreviewFromBehind {
    from { opacity: 0;    transform: scale(0.5); }
    to   { opacity: 0.65; transform: scale(0.92); }
}

.preview-to-center-right { animation: rightPreviewTowardCenter 0.28s cubic-bezier(0.4, 0, 0.7, 0.2) forwards; pointer-events: none; }
.preview-to-center-left  { animation: leftPreviewTowardCenter  0.28s cubic-bezier(0.4, 0, 0.7, 0.2) forwards; pointer-events: none; }
.preview-to-back-left    { animation: leftPreviewToBack  0.28s cubic-bezier(0.4, 0, 0.7, 0.2) forwards; pointer-events: none; }
.preview-to-back-right   { animation: rightPreviewToBack 0.28s cubic-bezier(0.4, 0, 0.7, 0.2) forwards; pointer-events: none; }

.preview-enter-from-center-left  { animation: leftPreviewFromCenter  0.45s cubic-bezier(0.25, 0.1, 0.25, 1) both; }
.preview-enter-from-center-right { animation: rightPreviewFromCenter 0.45s cubic-bezier(0.25, 0.1, 0.25, 1) both; }
.preview-enter-from-behind-right { animation: rightPreviewFromBehind 0.45s cubic-bezier(0.25, 0.1, 0.25, 1) both; }
.preview-enter-from-behind-left  { animation: leftPreviewFromBehind  0.45s cubic-bezier(0.25, 0.1, 0.25, 1) both; }

/* Initials text is invisible during all carousel transitions —
   prevents the letter pair (JT, JD…) from sliding visibly across the screen */
.preview-to-center-right .preview-initials,
.preview-to-center-left .preview-initials,
.preview-to-back-right .preview-initials,
.preview-to-back-left .preview-initials,
.preview-enter-from-center-left .preview-initials,
.preview-enter-from-center-right .preview-initials,
.preview-enter-from-behind-right .preview-initials,
.preview-enter-from-behind-left .preview-initials {
    opacity: 0;
}
