/* OS onboarding — the card deck. Vanilla CSS, no framework, no web fonts.
   The look follows the dataforge-web landing deck: dark stage, perspective
   grid, drifting orbs and ribbons, 9:16 cards that turn in 3D.
   Everything is scoped under .fbt-root so nothing leaks into the shell. */

.fbt-root {
    --fbt-purple:    #5a329a;
    --fbt-purple-hi: #8a5cf6;
    --fbt-orange:    #f39568;
    --fbt-teal:      #077c76;
    --fbt-dark:      #0a0812;
    --fbt-dark2:     #130e24;
    --fbt-ink:       #f6f3ff;
    --fbt-muted:     rgba(246, 243, 255, .6);
    --fbt-ease:      cubic-bezier(.16, 1, .3, 1);
    --fbt-card-h:    max(440px, min(calc(100dvh - 10.5rem), 660px));
    --fbt-card-w:    min(calc(100vw - 32px), max(320px, calc(var(--fbt-card-h) * 9 / 16)));

    position: fixed;
    inset: 0;
    z-index: 99000;
    overflow: hidden;
    isolation: isolate;
    background: radial-gradient(120% 90% at 50% 10%, var(--fbt-dark2) 0%, var(--fbt-dark) 60%);
    color: var(--fbt-ink);
    font: 15px/1.45 var(--os-font, "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif);
    opacity: 0;
    transition: opacity .42s var(--fbt-ease);
    -webkit-font-smoothing: antialiased;
}
.fbt-root[hidden] { display: none; }
.fbt-root.is-on { opacity: 1; }
/* Below the shell's own dialogs (z 9000) while one is open, still "visible" to shell.js */
.fbt-root.is-yielding { z-index: 8000; }
.fbt-root *, .fbt-root *::before, .fbt-root *::after { box-sizing: border-box; }
.fbt-root button { font: inherit; cursor: pointer; }
.fbt-root svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Backdrop ---------- */
.fbt-world { position: absolute; inset: -12%; z-index: 0; pointer-events: none; }
.fbt-grid {
    position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%;
    background-image:
        linear-gradient(rgba(138, 92, 246, .22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138, 92, 246, .22) 1px, transparent 1px);
    background-size: 64px 64px;
    transform: perspective(600px) rotateX(64deg);
    transform-origin: 50% 0;
    mask-image: linear-gradient(to bottom, transparent 0%, #000 35%, #000 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%, #000 70%, transparent 100%);
    animation: fbt-grid-run 3.2s linear infinite;
}
@keyframes fbt-grid-run { to { background-position: 0 64px, 0 0; } }

.fbt-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; mix-blend-mode: screen; }
.fbt-orb--a { width: 46vw; height: 46vw; left: 8%; top: 12%; background: var(--fbt-purple); animation: fbt-float 14s ease-in-out infinite; }
.fbt-orb--b { width: 34vw; height: 34vw; right: 10%; top: 26%; background: var(--fbt-orange); opacity: .35; animation: fbt-float 18s ease-in-out -6s infinite reverse; }
.fbt-orb--c { width: 28vw; height: 28vw; left: 40%; bottom: 8%; background: var(--fbt-teal); opacity: .4; animation: fbt-float 16s ease-in-out -3s infinite; }
@keyframes fbt-float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(6vw, -4vh, 0) scale(1.12); }
    66% { transform: translate3d(-4vw, 5vh, 0) scale(.92); }
}

.fbt-ribbons { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 3vh; transform: rotate(-8deg); }
.fbt-ribbon { display: flex; white-space: nowrap; width: max-content; animation: fbt-marquee 40s linear infinite; }
.fbt-ribbon--rev { animation-direction: reverse; animation-duration: 52s; }
.fbt-ribbon span {
    font-weight: 900; font-size: clamp(4rem, 14vw, 13rem); line-height: .9; letter-spacing: -.04em;
    color: transparent; -webkit-text-stroke: 1px rgba(246, 243, 255, .09);
}
@keyframes fbt-marquee { to { transform: translateX(-50%); } }

/* ---------- Deck frame ---------- */
.fbt-deck {
    position: relative; z-index: 1;
    height: 100%;
    display: flex; flex-direction: column;
    padding: max(1rem, env(safe-area-inset-top)) 16px max(1rem, env(safe-area-inset-bottom));
    transform: translateY(24px) scale(.98);
    transition: transform .6s var(--fbt-ease);
}
.fbt-root.is-on .fbt-deck { transform: none; }

.fbt-head {
    width: 100%; max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.fbt-title { margin: 0; font-size: clamp(1.6rem, 3.2vw, 2.6rem); font-weight: 900; letter-spacing: -.04em; line-height: 1; color: #fff; }
.fbt-head-actions { display: flex; gap: .5rem; }
.fbt-pill {
    display: inline-flex; align-items: center; gap: .45rem;
    color: #fff; background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(246, 243, 255, .25); border-radius: 999px;
    padding: .55rem 1rem; font-weight: 600; font-size: .88rem; white-space: nowrap;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: background .3s;
}
.fbt-pill:hover { background: rgba(255, 255, 255, .14); }
.fbt-pill:focus-visible, .fbt-nav:focus-visible, .fbt-btn:focus-visible { outline: 2px solid var(--fbt-orange); outline-offset: 2px; }
.fbt-sound svg { font-size: 1.05rem; }

/* ---------- Track + cards ---------- */
.fbt-track {
    position: relative; flex: 1 1 auto; min-height: calc(var(--fbt-card-h) + 24px);
    /* perspective only, no preserve-3d: a card lying in the track's own plane can lose clicks to it */
    perspective: 1600px;
    touch-action: pan-y; cursor: grab; outline: none;
    user-select: none; -webkit-user-select: none;
}
.fbt-track.is-dragging { cursor: grabbing; }

.fbt-card {
    position: absolute; left: 50%; top: 50%;
    width: var(--fbt-card-w); height: var(--fbt-card-h);
    margin-left: calc(var(--fbt-card-w) / -2);
    margin-top: calc(var(--fbt-card-h) / -2);
    border-radius: 28px; overflow: hidden;
    background: var(--fbt-dark2);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08);
    will-change: transform, opacity;
    color: #fff;
    transition: box-shadow .4s;
}
.fbt-card:not(.is-active) { cursor: pointer; }
.fbt-card.is-active { box-shadow: 0 50px 120px -30px rgba(138, 92, 246, .7), 0 0 0 1px rgba(255, 255, 255, .22); cursor: auto; }

.fbt-media, .fbt-poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.fbt-media::after { /* legibility */
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10, 8, 18, .3) 0%, rgba(10, 8, 18, 0) 22%, rgba(10, 8, 18, .45) 45%, rgba(10, 8, 18, .94) 72%);
}

/* Motion poster: the card's words scroll up behind a slow light sweep */
.fbt-poster { overflow: hidden; background: linear-gradient(160deg, var(--c1), var(--c2)); }
.fbt-poster::before {
    content: ''; position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 0 25%, rgba(255, 255, 255, .22) 30%, transparent 40% 70%, rgba(0, 0, 0, .25) 80%, transparent 90%);
    animation: fbt-spin 9s linear infinite paused;
}
.fbt-poster-words {
    position: absolute; left: 0; right: 0; top: 0;
    display: flex; flex-direction: column;
    animation: fbt-scroll-up 10s linear infinite paused;
}
.fbt-poster-words b {
    display: block; padding: 0 .35em;
    font-weight: 900; font-size: calc(var(--fbt-card-w) * .26); line-height: .9; letter-spacing: -.05em;
    text-transform: uppercase; color: rgba(255, 255, 255, .92);
}
.fbt-poster-words b:nth-child(even) { color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .7); text-align: right; }
.fbt-card.is-active .fbt-poster::before,
.fbt-card.is-active .fbt-poster-words { animation-play-state: running; }
@keyframes fbt-spin { to { transform: rotate(360deg); } }
@keyframes fbt-scroll-up { to { transform: translateY(-50%); } }

.fbt-card-index { position: absolute; top: 1rem; right: 1.1rem; z-index: 2; font-weight: 800; font-size: .8rem; letter-spacing: .1em; color: rgba(255, 255, 255, .75); }

.fbt-card-body {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 3.5rem 1.3rem 1.4rem;
    /* The poster keeps moving behind; this fade keeps titles and form fields readable over it */
    background: linear-gradient(180deg, rgba(10, 8, 18, 0) 0, rgba(10, 8, 18, .78) 3.5rem, rgba(10, 8, 18, .9) 100%);
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
/* The cards behind are scenery: a tap lands on the card itself and brings it round */
.fbt-card:not(.is-active) .fbt-card-body { pointer-events: none; }
.fbt-card:not(.is-active) .fbt-slot,
.fbt-card:not(.is-active) .fbt-actions,
.fbt-card:not(.is-active) .fbt-form-error,
.fbt-card:not(.is-active) .fbt-card-body p { opacity: 0; }
.fbt-slot, .fbt-actions, .fbt-card-body p { transition: opacity .35s; }

.fbt-tag {
    display: inline-block; margin-bottom: .7rem; padding: .3rem .7rem; border-radius: 999px;
    font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fbt-card h3 { margin: 0 0 .45rem; color: #fff; font-weight: 800; letter-spacing: -.03em; font-size: clamp(1.4rem, calc(var(--fbt-card-w) * .085), 2rem); line-height: 1.05; }
.fbt-card p { margin: 0 0 .9rem; color: rgba(255, 255, 255, .82); font-size: .92rem; line-height: 1.45; }

/* ---------- Forms on a card ---------- */
.fbt-slot:empty { display: none; }
.fbt-slot { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .9rem; }
.fbt-field { display: flex; flex-direction: column; gap: .3rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.fbt-field[hidden] { display: none; }
.fbt-field-label { padding: 0; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.fbt-field-hint { font-size: .74rem; line-height: 1.35; color: rgba(255, 255, 255, .55); }
.fbt-field input[type=text], .fbt-field input[type=password] {
    width: 100%; padding: .62rem .8rem;
    font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
    color: #fff; background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px;
    outline: none; transition: border-color .2s, background .2s;
    user-select: text; -webkit-user-select: text;
}
.fbt-field input::placeholder { color: rgba(255, 255, 255, .4); }
.fbt-field input:focus { border-color: var(--fbt-orange); background: rgba(255, 255, 255, .14); }

.fbt-choices { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem; }
.fbt-choices legend { width: 100%; margin-bottom: .3rem; }
.fbt-choice { position: relative; }
.fbt-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fbt-choice span {
    display: inline-block; padding: .45rem .95rem; border-radius: 999px;
    font-size: .86rem; font-weight: 600;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22);
    transition: background .2s, color .2s, border-color .2s;
}
.fbt-choice input:checked + span { background: #fff; color: var(--fbt-dark); border-color: #fff; }
.fbt-choice input:focus-visible + span { outline: 2px solid var(--fbt-orange); outline-offset: 2px; }

.fbt-form-error {
    margin: 0 0 .8rem; padding: .5rem .7rem; border-radius: 10px;
    font-size: .82rem; line-height: 1.35;
    background: rgba(243, 149, 104, .16); border: 1px solid rgba(243, 149, 104, .5); color: #ffd9c6;
}
.fbt-form-error[hidden] { display: none; }

/* ---------- Card buttons ---------- */
.fbt-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.fbt-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .65rem 1.1rem; border-radius: 999px;
    font-weight: 700; font-size: .88rem; line-height: 1.2;
    color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
    transition: gap .3s var(--fbt-ease), background .3s, color .3s;
}
.fbt-btn:hover { background: rgba(255, 255, 255, .18); }
.fbt-btn.is-primary { background: #fff; color: var(--fbt-dark); border-color: #fff; }
.fbt-btn.is-primary:hover { gap: .85rem; background: var(--fbt-orange); border-color: var(--fbt-orange); }
.fbt-btn i { display: inline-flex; font-style: normal; }
.fbt-btn.is-toggle[aria-pressed="true"] { background: rgba(138, 92, 246, .35); border-color: var(--fbt-purple-hi); }
.fbt-btn:disabled { opacity: .6; cursor: progress; }

/* ---------- Controls ---------- */
.fbt-controls { display: flex; align-items: center; justify-content: center; gap: 1.25rem; padding-top: .5rem; }
.fbt-nav {
    width: 3rem; height: 3rem; border-radius: 50%;
    border: 1px solid rgba(246, 243, 255, .25); background: rgba(255, 255, 255, .05);
    color: #fff; font-size: 1.15rem;
    display: grid; place-items: center;
    transition: background .3s, transform .3s var(--fbt-ease), opacity .3s;
}
.fbt-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .15); transform: scale(1.08); }
.fbt-nav:disabled { opacity: .3; cursor: default; }
.fbt-count { font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: #fff; min-width: 5.5rem; text-align: center; }
.fbt-count-sep { margin: 0 .4rem; color: var(--fbt-muted); }

/* ---------- Small screens ---------- */
@media (max-width: 767px) {
    .fbt-root { --fbt-card-h: max(420px, min(calc(100dvh - 9.5rem), 600px)); }
    .fbt-title { font-size: 1.5rem; }
    .fbt-pill { padding: .5rem .8rem; font-size: .82rem; }
    .fbt-sound span { display: none; }
    .fbt-card { border-radius: 24px; }
    .fbt-card-body { padding: 3rem 1rem 1.1rem; }
    .fbt-controls { gap: 1rem; }
    .fbt-nav { width: 2.6rem; height: 2.6rem; }
}
@media (max-height: 620px) {
    .fbt-root { --fbt-card-h: max(380px, calc(100dvh - 8rem)); }
    .fbt-field-hint { display: none; }
}

/* ---------- Reduced motion / transparency ---------- */
@media (prefers-reduced-motion: reduce) {
    .fbt-grid, .fbt-orb, .fbt-ribbon, .fbt-poster::before, .fbt-poster-words { animation: none !important; }
    .fbt-root, .fbt-deck { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .fbt-pill, .fbt-tag { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- Account cards (/os/account/: create, change, recover) ---------- */
.fbt-code {
    display: block; width: 100%; padding: .75rem .8rem; border-radius: 12px;
    font: 700 1.05rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em;
    text-align: center; color: #fff; background: rgba(255, 255, 255, .1); border: 1px dashed rgba(255, 255, 255, .4);
    user-select: all; -webkit-user-select: all; word-break: break-all;
}
.fbt-code-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.fbt-check { display: flex; align-items: flex-start; gap: .55rem; font-size: .88rem; line-height: 1.35; color: rgba(255, 255, 255, .88); cursor: pointer; }
.fbt-check input { width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; accent-color: var(--fbt-orange); flex: none; }
.fbt-root.is-locked .fbt-head { justify-content: center; }

/* ---------- Head: title + progress ("3 of 6 done") ---------- */
.fbt-head-text { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.fbt-progress { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fbt-muted); }
.fbt-progress[hidden] { display: none; }
.fbt-card-index.is-done { color: #6ee7d8; font-size: 1rem; }

/* ---------- Fly-out deck (onboarding only: .has-flyout) ----------
   In the deck a card shows its poster, tag and title; tapping the front card flies
   it out to 90% of the screen with its text and buttons (hud.js flyOut()). */
.fbt-root.has-flyout .fbt-card:not(.fbt-flycard) .fbt-card-body p,
.fbt-root.has-flyout .fbt-card:not(.fbt-flycard) .fbt-slot,
.fbt-root.has-flyout .fbt-card:not(.fbt-flycard) .fbt-actions,
.fbt-root.has-flyout .fbt-card:not(.fbt-flycard) .fbt-form-error { display: none; }
.fbt-root.has-flyout .fbt-card:not(.fbt-flycard) .fbt-card-body { pointer-events: none; overflow: hidden; }
.fbt-open-hint { display: none; }
.fbt-root.has-flyout .fbt-card.is-active:not(.fbt-flycard) { cursor: pointer; }
.fbt-root.has-flyout .fbt-card.is-active:not(.fbt-flycard) .fbt-open-hint {
    display: inline-flex; position: absolute; z-index: 3; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
    padding: .5rem 1rem; border-radius: 999px; white-space: nowrap;
    font-size: .82rem; font-weight: 700; color: var(--fbt-dark); background: #fff;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
    animation: fbt-hint 2.4s var(--fbt-ease) infinite;
}
.fbt-root.has-flyout .fbt-card:not(.fbt-flycard) .fbt-card-body { padding-bottom: 4.2rem; }
@keyframes fbt-hint { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
.fbt-card.is-emptied { box-shadow: none; background: transparent; }

.fbt-fly { position: absolute; inset: 0; z-index: 500; }
.fbt-fly-backdrop { position: absolute; inset: 0; background: rgba(5, 4, 10, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.fbt-root .fbt-card.fbt-flycard {
    position: absolute; left: 5vw; top: 5vh; top: 5dvh; margin: 0;
    width: 90vw; height: 90vh; height: 90dvh;
    transform: none; opacity: 1; z-index: 2; cursor: auto; transform-origin: 0 0;
    box-shadow: 0 60px 140px -40px rgba(138, 92, 246, .75), 0 0 0 1px rgba(255, 255, 255, .2);
}
.fbt-flycard .fbt-open-hint { display: none !important; }
.fbt-flycard .fbt-card-body {
    max-height: none; overflow-y: auto; display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(180deg, rgba(19, 14, 36, .2), rgba(19, 14, 36, .96) 28%);
}
.fbt-flycard .fbt-tag { align-self: flex-start; }
.fbt-flycard h3 { font-size: clamp(1.8rem, 3vw, 3rem); }
.fbt-flycard p { font-size: 1rem; max-width: 38em; }
.fbt-flycard .fbt-slot, .fbt-flycard .fbt-form-error { max-width: 30rem; }
.fbt-fly-close {
    position: absolute; top: 14px; right: 14px; z-index: 4;
    width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: rgba(10, 8, 18, .55); border: 1px solid rgba(255, 255, 255, .25); font-size: 1.1rem;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fbt-fly-close:hover { background: rgba(255, 255, 255, .16); }
.fbt-fly-nav {
    position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
    width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: rgba(255, 255, 255, .06); border: 1px solid rgba(246, 243, 255, .25); font-size: 1.1rem;
}
.fbt-fly-nav.is-prev { left: max(4px, calc(2.5vw - 1.3rem)); }
.fbt-fly-nav.is-next { right: max(4px, calc(2.5vw - 1.3rem)); }
.fbt-fly-nav:disabled { opacity: .3; cursor: default; }
.fbt-fly-close:focus-visible, .fbt-fly-nav:focus-visible { outline: 2px solid var(--fbt-orange); outline-offset: 2px; }

/* Wide screens: poster on the left, the words and buttons on the right */
@media (min-width: 768px) and (min-aspect-ratio: 1/1) {
    .fbt-flycard .fbt-media { right: auto; width: 42%; }
    .fbt-flycard .fbt-media::after { background: linear-gradient(90deg, rgba(10, 8, 18, 0) 55%, rgba(19, 14, 36, .9) 100%); }
    .fbt-flycard .fbt-card-body { left: 42%; top: 0; padding: 3.5rem clamp(2rem, 4vw, 4rem); background: var(--fbt-dark2); }
    .fbt-flycard .fbt-card-index { right: auto; left: 1.2rem; }
}
/* Narrow or tall screens: a poster band on top, content below */
@media (max-width: 767px), (max-aspect-ratio: 1/1) {
    .fbt-flycard .fbt-media { bottom: auto; height: 24%; }
    .fbt-flycard .fbt-card-body { top: 15%; padding: 2.2rem 1.2rem 1.2rem; justify-content: flex-start; }
    .fbt-flycard h3 { font-size: 1.7rem; }
    .fbt-flycard .fbt-slot { gap: .45rem; }
    .fbt-fly-nav { display: none; }
}

/* ---------- Guiding: the deck steps aside for the real desktop ---------- */
.fbt-root.is-guiding { background: transparent; pointer-events: none; }
.fbt-root .fbt-world, .fbt-root .fbt-deck, .fbt-root .fbt-fly { transition: opacity .3s var(--fbt-ease), visibility .3s; }
.fbt-root.is-guiding .fbt-world,
.fbt-root.is-guiding .fbt-deck,
.fbt-root.is-guiding .fbt-fly { opacity: 0; visibility: hidden; }

.fbt-guide { position: absolute; inset: 0; z-index: 900; pointer-events: none; opacity: 0; transition: opacity .25s var(--fbt-ease); }
.fbt-guide[hidden] { display: none; }
.fbt-guide.is-on { opacity: 1; }
/* .fbt-root svg sizes icons to 1em: the dim layer must win that, or it shrinks to a dot */
.fbt-root .fbt-guide-dim { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fbt-root .fbt-guide-dim path { fill: rgba(5, 4, 10, .58); stroke: none; pointer-events: visiblePainted; }
.fbt-guide-ring {
    position: absolute; border-radius: 12px; pointer-events: none; opacity: 0;
    border: 2px solid var(--fbt-orange);
    box-shadow: 0 0 0 4px rgba(243, 149, 104, .25), 0 0 32px rgba(243, 149, 104, .55);
    transition: left .2s var(--fbt-ease), top .2s var(--fbt-ease), width .2s var(--fbt-ease), height .2s var(--fbt-ease), opacity .2s;
    animation: fbt-ring 1.6s ease-in-out infinite;
}
.fbt-guide-ring.is-on { opacity: 1; }
@keyframes fbt-ring { 0%, 100% { box-shadow: 0 0 0 4px rgba(243, 149, 104, .25), 0 0 24px rgba(243, 149, 104, .45); } 50% { box-shadow: 0 0 0 9px rgba(243, 149, 104, .12), 0 0 40px rgba(243, 149, 104, .7); } }
.fbt-guide.is-success .fbt-guide-ring { border-color: #6ee7d8; box-shadow: 0 0 0 6px rgba(110, 231, 216, .3), 0 0 40px rgba(110, 231, 216, .6); }

.fbt-coach {
    position: absolute; left: 50%; transform: translateX(-50%);
    width: min(440px, calc(100vw - 32px)); pointer-events: auto;
    padding: .9rem 1.1rem 1rem; border-radius: 20px;
    color: var(--fbt-ink); background: rgba(19, 14, 36, .95);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(138, 92, 246, .25);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.fbt-coach.is-top { top: max(16px, env(safe-area-inset-top)); }
.fbt-coach.is-bottom { bottom: calc(88px + env(safe-area-inset-bottom)); }
.fbt-coach-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.fbt-coach-step { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fbt-muted); }
.fbt-coach-back { padding: .25rem .1rem; border: 0; background: none; color: rgba(255, 255, 255, .75); font-size: .8rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.fbt-coach-back:hover { color: #fff; }
.fbt-coach-say { margin: .45rem 0 .8rem; font-size: 1.05rem; font-weight: 600; line-height: 1.4; color: #fff; }
.fbt-coach-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.fbt-coach-actions:empty { display: none; }
.fbt-coach.is-nudge { animation: fbt-nudge .4s ease-in-out; }
@keyframes fbt-nudge { 20%, 60% { transform: translateX(calc(-50% - 6px)); } 40%, 80% { transform: translateX(calc(-50% + 6px)); } }
.fbt-coach-back:focus-visible { outline: 2px solid var(--fbt-orange); outline-offset: 2px; }

/* ---------- Hatching placeholder (a future module replaces it: actions.js hatchAssistant) ---------- */
.fbt-egg { position: relative; width: 96px; height: 122px; margin: .2rem 0 .4rem; }
.fbt-egg-shell {
    position: absolute; inset: 0; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
    background: radial-gradient(circle at 35% 30%, #fff 0, #ffe9dc 30%, #f39568 100%);
    box-shadow: inset -10px -14px 24px rgba(90, 50, 154, .35), 0 18px 40px -12px rgba(243, 149, 104, .6);
    transition: transform .6s var(--fbt-ease), opacity .6s;
}
.fbt-egg-crack {
    position: absolute; left: 18%; right: 18%; top: 44%; height: 14px; opacity: 0;
    background: linear-gradient(135deg, transparent 45%, #5a329a 45% 55%, transparent 55%) 0 0 / 16px 14px repeat-x;
    transition: opacity .3s;
}
.fbt-egg.is-hatching .fbt-egg-shell { animation: fbt-wobble .5s ease-in-out 4; }
.fbt-egg.is-hatching .fbt-egg-crack { opacity: 1; transition-delay: 1.4s; }
.fbt-egg.is-hatched .fbt-egg-shell { transform: scale(1.15); opacity: 0; }
.fbt-egg.is-hatched::after {
    content: ''; position: absolute; inset: 14px; border-radius: 50%;
    background: radial-gradient(circle, #fff 0, #8a5cf6 45%, transparent 70%);
    animation: fbt-glow 1.8s ease-in-out infinite;
}
@keyframes fbt-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes fbt-glow { 0%, 100% { transform: scale(.9); opacity: .8; } 50% { transform: scale(1.05); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .fbt-guide-ring, .fbt-coach.is-nudge, .fbt-open-hint, .fbt-egg-shell, .fbt-egg.is-hatched::after { animation: none !important; }
    .fbt-guide-ring { transition: none; }
}
