:root {
    --pplx-orange: #FA6A2A;
    --pplx-ink: #111827;
    --pplx-muted: #6B7280;
    --pplx-line: #E5E7EB;
    --pplx-soft: #FFF7ED;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.learn *,
.learn-wrap *,
.cc-wrap *,
.vp-wrap *,
.dp-wrap *,
.sc-wrap *,
.iv-wrap *,
.ck-wrap *,
.fn-wrap *,
.pplx-dashboard * {
    letter-spacing: 0;
}

.learn-wrap,
.cc-wrap,
.vp-wrap,
.dp-wrap,
.sc-wrap,
.iv-wrap,
.ck-wrap,
.fn-wrap {
    font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
}

.pplx-avatar,
.cc-avatar,
.vp-avatar,
.dp-intro-avatar,
.sc-avatar,
.sc-intro-avatar,
.iv-intro-avatar,
.fn-avatar,
.fn-big-avatar {
    animation: pplxAvatarIn 520ms cubic-bezier(.2, .9, .2, 1.2) both;
    transform-origin: 50% 80%;
}

@keyframes pplxAvatarIn {
    0% { opacity: 0; transform: translateY(14px) scale(.78); }
    60% { opacity: 1; transform: translateY(-3px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.pplx-word-pop {
    display: inline-block;
    opacity: 0;
    animation: pplxWord 280ms ease forwards;
}

@keyframes pplxWord {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.pplx-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #FFF7ED 0%, #F3F4F6 40%, #FFF7ED 80%);
    border-radius: 14px;
    min-height: 180px;
}

.pplx-skeleton:after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
    animation: pplxShimmer 1.25s ease-in-out infinite;
}

@keyframes pplxShimmer {
    100% { transform: translateX(100%); }
}

.pplx-friendly-state {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #F3E8D7;
    background: #FFFDF8;
    border-radius: 14px;
    color: #374151;
}

.pplx-friendly-state .pplx-state-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFEDD5;
    font-size: 30px;
    flex: 0 0 auto;
}

.pplx-offline-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    padding: 12px 14px;
    background: #111827;
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(15,23,42,.24);
    font-size: 13px;
}

body.pplx-is-offline .pplx-offline-banner {
    display: flex;
}

.pplx-confetti {
    position: fixed;
    z-index: 99999;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    animation: pplxConfetti 920ms ease-out forwards;
}

@keyframes pplxConfetti {
    0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) rotate(420deg) scale(.7); }
}

.pplx-xp-float {
    position: fixed;
    z-index: 99998;
    top: 56%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 16px;
    border-radius: 999px;
    background: #FFEDD5;
    color: #C2410C;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(194,65,12,.18);
    animation: pplxXpFloat 1000ms cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes pplxXpFloat {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(.82); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
    100% { opacity: 0; transform: translate(-50%, -180%) scale(.94); }
}

.pplx-celebrate-card {
    position: relative;
    overflow: hidden;
}

.pplx-celebrate-card:before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, rgba(250,106,42,.16) 0%, transparent 60%);
    opacity: 0;
    animation: pplxCelebrateGlow 900ms ease-out forwards;
    pointer-events: none;
}

@keyframes pplxCelebrateGlow {
    0% { opacity: 0; transform: scale(.65); }
    45% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.25); }
}

.pplx-repress {
    animation: pplxRepress 1150ms ease-in-out infinite;
}

@keyframes pplxRepress {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 0 rgba(250,106,42,0); }
    50% { transform: translateY(1px); box-shadow: 0 0 0 5px rgba(250,106,42,.12); }
}

.pplx-touch-flash {
    position: fixed;
    z-index: 99997;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    pointer-events: none;
    opacity: .72;
    background: rgba(34,197,94,.42);
    animation: pplxTapFlash 340ms ease-out forwards;
}

.pplx-touch-flash.err {
    background: rgba(239,68,68,.42);
}

@keyframes pplxTapFlash {
    from { transform: scale(.8); opacity: .75; }
    to { transform: scale(5.4); opacity: 0; }
}

.pplx-ring {
    --pct: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color, #FA6A2A) calc(var(--pct) * 1%), #F3F4F6 0);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.pplx-ring > span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #111827;
    font-weight: 800;
}

.pplx-streak-flame.at-risk,
.streak-flame.at-risk img {
    animation: pplxFlame 680ms ease-in-out infinite;
    transform-origin: 50% 80%;
}

@keyframes pplxFlame {
    0%, 100% { transform: rotate(-2deg) scale(1); filter: saturate(1); }
    50% { transform: rotate(2deg) scale(1.08); filter: saturate(1.3); }
}

.pplx-count-pop {
    animation: pplxCountPop 340ms ease-out;
}

@keyframes pplxCountPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); color: #FA6A2A; }
    100% { transform: scale(1); }
}

.ad-slot.learn-path-ad,
.ad-slot.dashboard-learn-ad,
.ad-slot.lesson-celebration-ad {
    margin-top: 18px;
    margin-bottom: 22px;
}

@media (max-width: 575px) {
    .cc-wrap,
    .vp-wrap,
    .dp-wrap,
    .sc-wrap,
    .iv-wrap,
    .ck-wrap,
    .fn-wrap,
    .learn-wrap {
        padding-left: 14px;
        padding-right: 14px;
    }

    .cc-btn,
    .vp-btn,
    .dp-btn,
    .sc-btn,
    .iv-btn,
    .ck-btn,
    .fn-btn,
    .learn-continue,
    .les-resume-btn {
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    .pplx-friendly-state {
        align-items: flex-start;
    }
}
