/* TippFlug · pro.css — plans & paywall, Bibo marketing fly-by, customer area, language switch, Arabic / RTL */

/* ---------- tier chips ---------- */
.tier { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 0.95rem; padding: 6px 14px; border-radius: 99px; }
.tier.sm { font-size: 0.78rem; padding: 3px 10px; align-self: flex-start; }
.tier .ic { width: 1em; height: 1em; }
.tier-pro { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300; box-shadow: 0 0 18px rgba(245, 158, 11, 0.35); }
.tier-trial { background: var(--grad); color: #fff; }
.tier-free { background: var(--surface-3); color: var(--muted); }
.pro-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 99px; background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300; margin-inline-start: 6px; vertical-align: middle; }
.pro-chip .ic { width: 0.95em; height: 0.95em; }

/* ---------- sidebar extras ---------- */
.nav a.nav-pro .ic { color: #fbbf24; }
.nav a.nav-pro.active .ic { color: #fff; }
.lang-switch { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.lang-switch button { flex: 1; min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 900; cursor: pointer; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { background: var(--grad); color: #fff; }
a.player { text-decoration: none; color: inherit; }
a.player:hover { border-color: var(--border-strong); }

/* ---------- plan bar on home ---------- */
.plan-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; margin-bottom: 16px; border-radius: 16px; text-decoration: none; color: var(--text);
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 22%, transparent), color-mix(in srgb, #f59e0b 18%, transparent));
  border: 1px solid color-mix(in srgb, #fbbf24 35%, transparent); }
.plan-bar > .ic { color: #fbbf24; width: 22px; height: 22px; }
.plan-bar > span:first-of-type { flex: 1; }
.plan-bar-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: #fde68a; white-space: nowrap; }
.plan-bar:hover { border-color: #fbbf24; }

/* ---------- plans ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 8px; text-align: start; }
.plan { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 18px 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.plan h3 { font-size: 1.1rem; font-weight: 900; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price b { font-size: 2rem; font-weight: 900; line-height: 1.1; }
.plan-price span { color: var(--muted); font-weight: 700; }
.toggle.lessons-open { cursor: default; }
.toggle.lessons-open > .ic { width: 22px; height: 22px; color: var(--ok); }
.plan-price s { color: var(--muted); font-size: 1.15rem; font-weight: 800; text-decoration-thickness: 2px; text-decoration-color: var(--err); }
.plan-sub { color: var(--muted); font-size: 0.88rem; min-height: 2.6em; }
.plan-sub b { color: var(--primary-2); }
.plan-feat { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; font-size: 0.9rem; }
.plan-feat li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feat .ic { color: var(--ok); margin-top: 2px; }
.plan.best { background: linear-gradient(180deg, color-mix(in srgb, #f59e0b 12%, var(--surface-2)), var(--surface-2)); border: 2px solid #fbbf24; box-shadow: 0 0 34px rgba(251, 191, 36, 0.22); transform: translateY(-4px); }
.plan-badge { position: absolute; top: -13px; inset-inline-start: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 0.78rem; font-weight: 900; padding: 4px 12px; border-radius: 99px; background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300; }
[dir="rtl"] .plan-badge { transform: translateX(50%); }
.plan .btn[disabled] { opacity: 0.5; cursor: default; transform: none; }
.plan-note, .plan-disc { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; margin-top: 12px; text-align: center; }
.plan-disc { color: #fde68a; font-weight: 800; }
.plan-note .ic { color: var(--ok); }

/* ---------- paywall with Bibo flying in ---------- */
.modal.wide:has(.promo) { width: min(920px, 100%); }
.modal { overflow-x: hidden; }
[dir="rtl"] .promo-banner { transform-origin: right center; }
.promo { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.promo h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 900; }
.promo-x { position: absolute; top: -12px; inset-inline-end: -10px; z-index: 2; }
.promo-sky { position: relative; width: 100%; min-height: 110px; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; padding: 0 44px; }
.promo-bibo { position: relative; flex: none; width: 82px; animation: promoFly 1.1s cubic-bezier(0.2, 0.9, 0.3, 1.1) both, hover 3s ease-in-out 1.1s infinite; }
.promo-bibo svg { width: 100%; }
.promo-bibo .eyes-happy, .promo-bibo .mouth-smile { display: inline; }
.promo-rope { flex: none; width: 30px; height: 2px; background: repeating-linear-gradient(90deg, #fde68a 0 6px, transparent 6px 10px); animation: promoIn 0.6s ease 0.8s both; }
.promo-banner { position: relative; min-width: 0; max-width: 100%; padding: 10px 18px; border-radius: 14px; font-weight: 900; line-height: 1.3; text-align: center; color: #3b2300;
  background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 8px 26px rgba(245, 158, 11, 0.4); transform-origin: left center; animation: promoBanner 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) 0.85s both, bannerWave 2.4s ease-in-out 1.6s infinite; }
@keyframes promoFly { from { transform: translate(420px, -60px) rotate(18deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }
@keyframes promoIn { from { opacity: 0; } }
@keyframes promoBanner { from { opacity: 0; transform: scaleX(0.2) rotate(-4deg); } }
@keyframes bannerWave { 50% { transform: rotate(-2deg) translateY(2px); } }
.promo-foot { margin-top: 10px; }
.promo-foot a { display: inline-flex; gap: 8px; align-items: center; color: var(--primary-2); font-weight: 800; }
.ov-bibo { width: 70px; margin: -60px auto 4px; animation: hover 3s ease-in-out infinite; }
.ov-bibo svg { width: 100%; }
.ov-bibo .eyes-wow, .ov-bibo .mouth-o { display: inline; }

/* ---------- Bibo fly-by advertising banner ---------- */
.flyby { position: fixed; top: 84px; left: 100%; z-index: 55; display: flex; align-items: center; gap: 0; border: 0; padding: 0; background: none; cursor: pointer; color: inherit; font: inherit;
  animation: flyAcross 14s linear forwards; }
.flyby-bibo { width: 64px; height: 80px; flex: none; animation: hover 1.6s ease-in-out infinite; }
.flyby-bibo svg { width: 100%; height: 100%; overflow: visible; }
.flyby-bibo .eyes-happy, .flyby-bibo .mouth-smile { display: inline; }
.flyby-rope { width: 40px; height: 2px; background: repeating-linear-gradient(90deg, #fde68a 0 6px, transparent 6px 10px); }
.flyby-banner { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px 4px 4px 12px; font-weight: 900; white-space: nowrap; color: #3b2300;
  background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); animation: bannerWave 1.8s ease-in-out infinite; }
.flyby:hover .flyby-banner { filter: brightness(1.08); }
@keyframes flyAcross { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 100%)); } }
[dir="rtl"] .flyby { left: auto; right: 100%; flex-direction: row-reverse; animation-name: flyAcrossRtl; }
[dir="rtl"] .flyby-bibo svg { transform: scaleX(-1); }
@keyframes flyAcrossRtl { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 100%)); } }

/* ---------- customer area ---------- */
.acc-badge { margin: 4px 0 10px; }
.acc-lines { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.acc-lines b { color: var(--text); }
.redeem { display: flex; gap: 10px; align-items: stretch; margin-top: 10px; }
.redeem textarea { flex: 1; min-height: 56px; resize: vertical; font: inherit; font-family: var(--mono); font-size: 0.9rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 12px; word-break: break-all; }
.redeem textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-2) 25%, transparent); }
.redeem-msg { min-height: 1.6em; margin-top: 10px; font-weight: 800; display: flex; gap: 6px; align-items: center; }
.redeem-msg.ok { color: var(--ok); }
.redeem-msg.bad { color: var(--err); }
.faq { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: '+'; color: var(--primary-2); font-weight: 900; }
.faq[open] summary::after { content: '–'; }
.faq p { color: var(--muted); margin-top: 6px; }
.lang-pick select { min-height: 40px; padding: 6px 10px; }
.lang-pick { min-width: 160px; }
.topic.locked { opacity: 0.8; }
.topic-badge .ic { width: 24px; height: 24px; }
button.lesson-tile { font: inherit; color: inherit; text-align: start; cursor: pointer; width: 100%; }
button.lesson-tile.pro { opacity: 0.75; }
button.lesson-tile.pro:hover { opacity: 1; border-color: #fbbf24; }

/* ---------- onboarding ---------- */
.choice-row.three { grid-template-columns: repeat(3, 1fr); }
.ob-trial { display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 800; color: #fde68a; }

/* ---------- Arabic keyboard keys ---------- */
.key .kar { font-family: 'Cairo', 'Noto Naskh Arabic', sans-serif; font-size: 1.25em; line-height: 1; }
.key .klat { position: absolute; bottom: 3px; inset-inline-end: 6px; font-size: 0.62em; opacity: 0.45; font-family: var(--mono); }
.kb-ar .key .ks { font-family: 'Cairo', sans-serif; }

/* ---------- Arabic / RTL ---------- */
html[lang="ar"] body { font-family: 'Cairo', 'Noto Naskh Arabic', var(--font); }
html[lang="ar"] * { letter-spacing: 0 !important; }
html[lang="ar"] .eyebrow, html[lang="ar"] .field-label, html[lang="ar"] .live-item span, html[lang="ar"] .hud-item span { text-transform: none; }
.typer[dir="rtl"] { font-family: 'Noto Naskh Arabic', 'Cairo', serif; font-size: clamp(1.3rem, 2.6vw, 1.95rem); }
.typer[dir="rtl"] .tline { white-space: pre; }
.word:dir(rtl), .typed-line:dir(rtl) { font-family: 'Noto Naskh Arabic', 'Cairo', serif; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
[dir="rtl"] .hud-lives { margin-left: 0; margin-right: auto; }
[dir="rtl"] .weak-row .btn { margin-left: 0; margin-right: auto; }
[dir="rtl"] .panel h2 small { margin-left: 0; margin-right: auto; }
[dir="rtl"] .stage-title small { padding-left: 0; padding-right: 46px; }
[dir="rtl"] .rec { border-left-width: 1px; border-right: 4px solid var(--c); }
[dir="rtl"] .toasts { right: auto; left: 16px; }
[dir="rtl"] .toast { transform: translateX(-120%); }
[dir="rtl"] .toast.in { transform: none; }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--border); }
[dir="rtl"] .lt-num { right: auto; left: 14px; }
[dir="rtl"] .lt-title { padding-right: 0; padding-left: 26px; }
[dir="rtl"] .bibo-close { right: auto; left: 6px; }
[dir="rtl"] .bibo-bubble { padding: 14px 16px 14px 36px; }
[dir="rtl"] .brand-name { direction: ltr; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .plans { grid-template-columns: 1fr; }
  .plan.best { transform: none; }
}
@media (max-width: 860px) {
  .lang-switch { display: none; }
  .flyby { top: 12px; }
}
@media (max-width: 520px) {
  .choice-row.three { grid-template-columns: 1fr; }
  .redeem { flex-direction: column; }
  .plan-bar { flex-wrap: wrap; }
  .promo-banner { font-size: 0.85rem; padding: 8px 12px; }
}

@media (max-width: 980px) { .plan.best { order: -1; margin-top: 10px; } }
