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

:root {
    --bg: #08080f;
    --surface: #0f0f1c;
    --card: #14142a;
    --elevated: #1c1c3c;
    --hairline: #ffffff0e;

    --blue: #0050FF;
    --blue-light: #3d7dff;
    --blue-glow: #0050ff3d;
    --neon: #35c8ff;
    --signal: #E8B93B;
    --ember: #FF7A45;
    --green: #23D18B;
    --green-dark: #0f8b58;
    --red: #FF4D5E;
    --red-dark: #a8202f;

    --text: #edeff6;
    --text-mid: #8b97ab;
    --text-dim: #4a5568;

    --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Consolas', monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    --radius: 15px;
    --radius-sm: 11px;
    --nav-height: 62px;
    --top-height: 50px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 460px;
    margin: 0 auto;
    position: relative;
}

/* Icons inherit color from their container and never shrink in flex rows. */
.ic { display: block; flex-shrink: 0; }

/* Small uppercase label used above headings and section titles. */
.section-eyebrow, .greeting-eyebrow, .complete-eyebrow, .modal-eyebrow {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-dim);
}

/* ===== TOP BAR ===== */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--top-height);
    padding: 0 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
    z-index: 10;
}
.top-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 18px;
}
.stat-icon { display: flex; }
.stat-val {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
#stat-streak { color: var(--ember); }
#stat-bits { color: var(--blue-light); }
#stat-xp { color: var(--signal); }

/* ===== SCREENS ===== */
#screen-container { flex: 1; overflow: hidden; position: relative; }
.screen {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity .22s ease, transform .22s ease;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.active { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ===== HOME ===== */
.tree-header { padding: 20px 20px 4px; }
.panther-greeting { display: flex; align-items: center; gap: 13px; }
#panther-mascot {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    box-shadow: 0 0 18px var(--blue-glow);
    overflow: hidden;
    flex-shrink: 0;
}
.panther-svg { width: 100%; height: 100%; display: block; }
.greeting-block { display: flex; flex-direction: column; gap: 3px; }
.greeting-line {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

#skill-tree {
    padding: 18px 0 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-divider {
    width: calc(100% - 44px);
    padding: 18px 0 10px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.category-divider::before, .category-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffffff1a, transparent);
}
.category-divider span {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Bottom padding reserves room for the absolutely-placed label; rows whose
   node carries the "Iniciar" badge also need headroom above. */
.skill-row {
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
    padding: 8px 0 30px;
}
.skill-row.has-badge { padding-top: 36px; }
.skill-connector {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 16px;
    border-radius: 2px;
}
.skill-row.has-badge .skill-connector { top: 8px; }
.skill-connector.available, .skill-connector.completed {
    background: var(--blue);
    box-shadow: 0 0 7px var(--blue-glow);
}
.skill-connector.locked { background: #2a3242; }

.skill-node {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform .15s;
}
.skill-node:active { transform: scale(.92); }

.skill-node.available {
    background: linear-gradient(150deg, var(--blue), #002d99);
    border: 2.5px solid var(--blue-light);
    color: #fff;
    box-shadow: 0 3px 18px var(--blue-glow), 0 0 34px #0050ff1f;
    animation: pulse-glow 2.6s ease-in-out infinite;
}
.skill-node.completed {
    background: linear-gradient(150deg, #14264a, #0d1c38);
    border: 2.5px solid var(--neon);
    color: var(--neon);
    box-shadow: 0 2px 12px #35c8ff26;
}
.skill-node.locked {
    background: var(--card);
    border: 2.5px solid #262e3d;
    color: var(--text-dim);
    cursor: default;
}

.crown-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: var(--signal);
    color: #241c00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px #e8b93b4d;
}

.skill-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--text-dim);
    white-space: nowrap;
}
.skill-node.available .skill-label { color: var(--text); }
.skill-node.completed .skill-label { color: var(--neon); }

/* Sits above the node so it never collides with the row below. */
.skill-start-badge {
    position: absolute;
    top: -29px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blue);
    color: #fff;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 10px var(--blue-glow);
    animation: bounce-subtle 1.6s ease-in-out infinite;
}
.skill-start-badge::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--blue);
    transform: translateX(-50%) rotate(45deg);
    border-radius: 1px;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 3px 18px var(--blue-glow), 0 0 34px #0050ff1f; }
    50%      { box-shadow: 0 3px 26px #0050ff5c, 0 0 52px #0050ff2e; }
}
@keyframes bounce-subtle {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-3px); }
}

/* ===== SKILL SHEET ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: #000000b8;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-sheet {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    border-top: 1px solid #ffffff14;
    padding: 11px 22px calc(22px + var(--safe-bottom));
    text-align: center;
    animation: slide-up .28s cubic-bezier(.32,.72,0,1);
}
@keyframes slide-up { from { transform: translateY(100%); } }
.modal-handle {
    width: 38px;
    height: 4px;
    background: #ffffff1f;
    border-radius: 2px;
    margin: 0 auto 16px;
}
.modal-skill-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--blue), #002d99);
    border: 2.5px solid var(--blue-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 22px var(--blue-glow);
}
.modal-eyebrow { margin-bottom: 5px; }
.modal-sheet h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.modal-sheet > p {
    font-size: 13px;
    color: var(--text-mid);
    margin-bottom: 16px;
}
#modal-crowns { display: flex; justify-content: center; gap: 7px; margin-bottom: 16px; }
.crown-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--card);
    border: 1.5px solid #ffffff12;
    color: #303a4d;
    display: flex;
    align-items: center;
    justify-content: center;
}
.crown-dot.earned {
    background: var(--signal);
    border-color: var(--signal);
    color: #241c00;
}

#modal-lessons { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.modal-lesson-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    background: var(--card);
    border-radius: var(--radius-sm);
    text-align: left;
}
.modal-lesson-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-mid);
    flex-shrink: 0;
}
.modal-lesson-row.done .modal-lesson-num { background: var(--green); color: #052a1a; }
.modal-lesson-title { font-size: 14px; font-weight: 600; }

/* ===== LESSON ===== */
.lesson-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
}
.btn-icon {
    width: 34px;
    height: 34px;
    border: none;
    background: var(--card);
    color: var(--text-mid);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:active { background: var(--elevated); }
.progress-bar-container {
    flex: 1;
    height: 12px;
    background: var(--card);
    border-radius: 6px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue), var(--neon));
    border-radius: 6px;
    transition: width .38s ease;
    box-shadow: 0 0 8px var(--blue-glow);
}
.lesson-bits {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--blue-light);
}
.lesson-bits-ico { display: flex; }

#lesson-content {
    flex: 1;
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
}
#question-area { text-align: center; }
.question-type {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--blue-light);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 10px;
}
.question-prompt {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
.question-prompt .blank {
    display: inline-block;
    min-width: 72px;
    border-bottom: 2.5px solid var(--blue);
    margin: 0 4px;
    padding: 0 4px;
    color: var(--blue-light);
    font-family: var(--mono);
    font-size: 17px;
}

#answer-area { display: flex; flex-direction: column; gap: 9px; }
.answer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    background: var(--card);
    border: 2px solid #ffffff0d;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .13s, background .13s, transform .13s;
}
.answer-option:active { transform: scale(.975); }
.answer-option.selected {
    border-color: var(--blue);
    background: #0050ff14;
    box-shadow: 0 0 12px var(--blue-glow);
}
.answer-option.correct   { border-color: var(--green) !important; background: #23d18b14 !important; }
.answer-option.incorrect { border-color: var(--red) !important;   background: #ff4d5e14 !important; }

.option-letter {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: var(--elevated);
    border: 1.5px solid #ffffff12;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mid);
    flex-shrink: 0;
    transition: background .13s, color .13s, border-color .13s;
}
.answer-option.selected .option-letter  { background: var(--blue); border-color: var(--blue); color: #fff; }
.answer-option.correct .option-letter   { background: var(--green); border-color: var(--green); color: #052a1a; }
.answer-option.incorrect .option-letter { background: var(--red); border-color: var(--red); color: #fff; }
.option-text { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.fillin-input {
    width: 100%;
    padding: 13px 15px;
    background: var(--card);
    border: 2px solid #ffffff12;
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--mono);
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color .18s;
}
.fillin-input::placeholder { font-family: var(--sans); color: var(--text-dim); font-weight: 500; }
.fillin-input:focus     { border-color: var(--blue); }
.fillin-input.correct   { border-color: var(--green); }
.fillin-input.incorrect { border-color: var(--red); }

#lesson-footer {
    padding: 12px 20px calc(12px + var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--hairline);
}
#feedback-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 11px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    animation: fade-in .18s ease;
}
#feedback-bar.hidden { display: none; }
#feedback-bar.correct-fb   { background: #23d18b14; color: var(--green); border: 1px solid #23d18b2e; }
#feedback-bar.incorrect-fb { background: #ff4d5e14; color: var(--red);   border: 1px solid #ff4d5e2e; }
#feedback-icon { display: flex; padding-top: 1px; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 0 #002d99, 0 4px 16px var(--blue-glow);
    transition: transform .1s, box-shadow .1s;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #002d99, 0 2px 9px var(--blue-glow); }
.btn-primary:disabled {
    background: var(--elevated);
    color: var(--text-dim);
    box-shadow: 0 4px 0 var(--card);
    cursor: default;
}
.btn-primary.btn-correct   { background: var(--green); box-shadow: 0 4px 0 var(--green-dark), 0 4px 16px #23d18b33; }
.btn-primary.btn-incorrect { background: var(--red);   box-shadow: 0 4px 0 var(--red-dark),   0 4px 16px #ff4d5e33; }

.btn-secondary {
    width: 100%;
    padding: 13px;
    border: 1.5px solid #3d7dff59;
    background: transparent;
    color: var(--blue-light);
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 9px;
}

/* ===== COMPLETE ===== */
.complete-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
    text-align: center;
    gap: 22px;
}
.complete-panther {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 3px solid var(--neon);
    overflow: hidden;
    box-shadow: 0 0 38px var(--blue-glow);
    animation: pop-in .42s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop-in { from { transform: scale(0); } }
.complete-heading { display: flex; flex-direction: column; gap: 6px; }
.complete-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(90deg, var(--blue-light), var(--neon));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.complete-stats { display: flex; gap: 26px; }
.complete-stat { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.complete-stat-val {
    font-family: var(--mono);
    font-size: 27px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--signal);
}
.complete-stat-label {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

/* ===== LEAGUES ===== */
.leagues-header { text-align: center; padding: 24px 20px 18px; }
.leagues-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 4px 0 18px;
}
#current-league-badge {
    width: 92px;
    height: 92px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid;
}
.league-caption {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-mid);
}
#leagues-list { padding: 0 20px 110px; display: flex; flex-direction: column; gap: 9px; }
.league-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1.5px solid transparent;
}
.league-row.current {
    border-color: var(--blue);
    background: #0050ff0f;
    box-shadow: 0 0 16px var(--blue-glow);
}
.league-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.league-info { flex: 1; }
.league-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.league-req {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-mid);
    letter-spacing: 0.02em;
}
.league-mark { display: flex; color: var(--text-dim); }
.league-mark.unlocked { color: var(--green); }

/* ===== PROFILE ===== */
.profile-header { text-align: center; padding: 30px 22px 18px; }
#profile-panther {
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 2.5px solid var(--neon);
    overflow: hidden;
    box-shadow: 0 0 28px var(--blue-glow);
}
#profile-level {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 4px 0 14px;
}
.xp-bar-container {
    height: 19px;
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--neon));
    border-radius: 10px;
    transition: width .55s ease;
}
.xp-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    text-shadow: 0 1px 3px #000000b3;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 0 20px 18px;
}
.profile-stat-card {
    padding: 15px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.profile-stat-icon { display: flex; }
.profile-stat-val {
    font-family: var(--mono);
    font-size: 21px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
/* Word values (a league name) need to sit lighter than the numeric ones. */
.profile-stat-val.is-word {
    font-family: var(--sans);
    font-size: 16px;
    letter-spacing: -0.015em;
}
.profile-stat-label {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.profile-achievements { padding: 0 20px 110px; }
.profile-achievements h3 { margin-bottom: 12px; }
#achievements-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.achievement {
    padding: 15px 7px;
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--hairline);
    text-align: center;
    color: var(--text-dim);
    opacity: .45;
}
.achievement.earned {
    opacity: 1;
    border-color: #e8b93b47;
    color: var(--signal);
}
.achievement-icon { display: flex; justify-content: center; margin-bottom: 7px; }
.achievement-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-mid);
    letter-spacing: -0.005em;
}
.achievement.earned .achievement-name { color: var(--text); }

/* ===== BOTTOM NAV ===== */
#bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--nav-height);
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    flex-shrink: 0;
    z-index: 10;
}
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 20px;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: color .18s;
}
.nav-ico { display: flex; transition: transform .18s; }
.nav-btn span:last-child {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.nav-btn.active { color: var(--blue-light); }
.nav-btn.active .nav-ico { transform: scale(1.08); }

/* Lesson takes over the whole viewport: header and footer pin, body scrolls. */
body.in-lesson #top-bar, body.in-lesson #bottom-nav { display: none; }
#screen-lesson {
    z-index: 5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lesson-top, #lesson-footer { flex-shrink: 0; }
#screen-lesson.active { animation: slide-up-full .3s ease; }
@keyframes slide-up-full { from { transform: translateY(100%); opacity: 0; } }

/* ===== FLOATING FEEDBACK ===== */
.xp-popup, .bit-lost {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--mono);
    font-weight: 700;
    z-index: 200;
    pointer-events: none;
}
.xp-popup {
    font-size: 38px;
    color: var(--signal);
    text-shadow: 0 2px 12px #e8b93b4d;
    animation: xp-float 1.1s ease forwards;
}
.bit-lost {
    font-size: 28px;
    color: var(--red);
    animation: bit-shake .8s ease forwards;
}
@keyframes xp-float {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(.6); }
    28%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
    100% { opacity: 0; transform: translate(-50%, -105%) scale(1); }
}
@keyframes bit-shake {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    20%  { transform: translate(-46%, -50%) scale(1.1); }
    40%  { transform: translate(-54%, -50%) scale(1.1); }
    60%  { transform: translate(-48%, -50%) scale(1.04); }
    100% { opacity: 0; transform: translate(-50%, -82%) scale(.85); }
}

/* ===== NO BITS ===== */
.no-bits-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000cc;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.no-bits-card {
    background: var(--surface);
    border: 1px solid #ffffff14;
    border-radius: 22px;
    padding: 30px 24px;
    text-align: center;
    max-width: 310px;
    width: calc(100% - 40px);
    animation: pop-in .3s cubic-bezier(.34,1.56,.64,1);
}
.no-bits-icon { display: flex; justify-content: center; color: var(--text-dim); margin-bottom: 14px; }
.no-bits-card h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 7px; }
.no-bits-card p { font-size: 13.5px; line-height: 1.5; color: var(--text-mid); margin-bottom: 20px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
