/* ==========================================================================
   YouPlay — modern responsive theme
   Mobile-first. Breakpoints: 576 / 768 / 992 / 1200 / 1440
   RTL (Arabic) handled with logical properties + [dir=rtl] tweaks.
   ========================================================================== */

:root {
  --bg: #0b0b18;
  --bg-2: #10101f;
  --surface: #161629;
  --surface-2: #1e1e38;
  --surface-3: #282848;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f3f3fa;
  --muted: #a4a4c4;
  --faint: #6d6d90;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #22d3ee;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --gold: #fbbf24;
  --silver: #cbd5e1;
  --bronze: #f59e0b;
  --ok: #22c55e;
  --danger: #f43f5e;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-glow: 0 10px 30px -10px rgba(139, 92, 246, .55);
  --gutter: 16px;
  --header-h: 60px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Cairo", "Poppins", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 768px)  { :root { --gutter: 24px; --header-h: 68px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { height: auto; min-height: 100%; }
body.yp-body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(139, 92, 246, .14), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(236, 72, 153, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  letter-spacing: 0;
}
[dir="rtl"] body.yp-body, .yp-lang-ar { font-family: var(--font-ar); }
img { max-width: 100%; height: auto; }
a { color: var(--text); text-decoration: none; transition: color .2s var(--ease); }
a:hover, a:focus { color: #fff; text-decoration: none; }
h1, h2, h3, h4, h5 { color: var(--text); font-weight: 700; line-height: 1.25; margin: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent-3); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(139, 92, 246, .45); color: #fff; }

.yp-skip { position: absolute; inset-inline-start: -999px; top: 8px; z-index: 2000; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #fff; }
.yp-skip:focus { inset-inline-start: 8px; }

.yp-container { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.yp-main { display: block; min-height: 60vh; padding-bottom: 24px; }
.yp-text-center { text-align: center; }

/* ---------- Buttons -------------------------------------------------------- */
.yp-btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--h); padding: 0 1.25em;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 14px/1 var(--font); letter-spacing: .02em; white-space: nowrap;
  color: #fff; background: var(--surface-2);
  cursor: pointer; user-select: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.yp-lang-ar .yp-btn { font-family: var(--font-ar); }
.yp-btn:hover, .yp-btn:focus { color: #fff; transform: translateY(-1px); }
.yp-btn:active { transform: translateY(0) scale(.98); }
.yp-btn--primary { background: var(--grad); box-shadow: var(--shadow-glow); }
.yp-btn--primary:hover { box-shadow: 0 14px 34px -10px rgba(236, 72, 153, .7); }
.yp-btn--ghost { background: transparent; border-color: var(--border-strong); }
.yp-btn--ghost:hover { background: var(--surface-2); border-color: var(--accent); }
.yp-btn--whatsapp { background: #25d366; color: #06290f; }
.yp-btn--whatsapp:hover { color: #06290f; background: #2ee874; }
.yp-btn--sm { --h: 36px; font-size: 13px; padding: 0 1em; }
.yp-btn--lg { --h: 52px; font-size: 16px; padding: 0 1.75em; }
.yp-btn--block { display: flex; width: 100%; }
@media (max-width: 575px) { .yp-btn--lg { --h: 46px; font-size: 15px; padding: 0 1.4em; } }

.yp-pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- Header -------------------------------------------------------- */
.yp-header {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(11, 11, 24, .78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s var(--ease), background .25s;
}
.yp-header.is-scrolled { background: rgba(11, 11, 24, .92); box-shadow: 0 8px 24px -16px rgba(0, 0, 0, .9); }
.yp-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--header-h); }
.yp-logo { display: inline-flex; align-items: center; min-width: 0; font-weight: 700; font-size: 20px; }
.yp-logo img { display: block; max-height: 34px; width: auto; }
@media (min-width: 768px) { .yp-logo img { max-height: 40px; } }
.yp-logo p { margin: 0; }
.yp-header__actions { display: flex; align-items: center; gap: 8px; }

.yp-icon-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; min-width: 40px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: 600 13px/1 var(--font); cursor: pointer;
  transition: background .2s, border-color .2s;
}
.yp-lang-ar .yp-icon-btn { font-family: var(--font-ar); }
.yp-icon-btn:hover, .open > .yp-icon-btn { background: var(--surface-2); border-color: var(--border-strong); }
.yp-icon-btn--accent { background: var(--grad); border-color: transparent; }
.yp-icon-btn--accent:hover, .open > .yp-icon-btn--accent { background: var(--grad); filter: brightness(1.08); border-color: transparent; }
.yp-icon-btn__label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .yp-icon-btn__label { display: none; } .yp-icon-btn { padding: 0; justify-content: center; } }
.yp-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: 12px; }
@media (max-width: 420px) { .yp-icon-btn .yp-avatar { width: 40px; height: 40px; background: transparent; font-size: 14px; } }

/* Dropdown menus (Bootstrap 3 behaviour, new skin) */
.yp-dropdown { position: relative; }
.yp-menu.dropdown-menu {
  margin-top: 10px; padding: 8px; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--text); font-size: 14px;
  inset-inline-end: 0; inset-inline-start: auto;
}
[dir="rtl"] .yp-menu.dropdown-menu-right { right: auto; left: 0; }
.yp-menu.dropdown-menu > li > a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); white-space: nowrap;
}
.yp-menu.dropdown-menu > li > a:hover, .yp-menu.dropdown-menu > li > a:focus { background: var(--surface-2); color: #fff; }
.yp-menu.dropdown-menu > .active > a, .yp-menu.dropdown-menu > .active > a:hover { background: rgba(139, 92, 246, .2); color: #fff; }
.yp-menu--form.dropdown-menu { width: 320px; padding: 20px; }
@media (max-width: 575px) {
  .yp-menu--form.dropdown-menu { position: fixed; top: calc(var(--header-h) + 4px); left: 12px; right: 12px; width: auto; margin: 0; }
}

/* Category chip bar */
.yp-catbar { border-top: 1px solid var(--border); }
.yp-chips {
  display: flex; gap: 8px; margin: 0; padding: 10px 0; list-style: none;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
}
.yp-chips::-webkit-scrollbar { display: none; }
@media (min-width: 1200px) { .yp-chips { justify-content: center; -webkit-mask-image: none; mask-image: none; } }
.yp-chips li { flex: 0 0 auto; scroll-snap-align: start; }
.yp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: all .2s var(--ease);
}
.yp-chip:hover, .yp-chip:focus { color: #fff; border-color: var(--border-strong); background: var(--surface-2); }
.yp-chip.is-active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: var(--shadow-glow); }

/* ---------- Hero / promo banners ----------------------------------------- */
.yp-hero { padding-top: 16px; }
@media (min-width: 768px) { .yp-hero { padding-top: 24px; } }
.yp-hero__frame {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.yp-hero__img, .yp-hero__img img { display: block; width: 100%; }
.yp-hero__img img { height: auto; min-height: 160px; object-fit: cover; transition: transform 1.2s var(--ease); }
.yp-hero--lg .yp-hero__img img { max-height: 620px; }
.yp-hero--md .yp-hero__img img { max-height: 420px; }
.yp-hero__frame:hover .yp-hero__img img { transform: scale(1.03); }
.yp-hero__shade { position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(to top, rgba(11, 11, 24, .85), transparent); pointer-events: none; z-index: 1; }
.yp-hero__cta {
  position: absolute; inset-inline: 0; bottom: 16px; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px;
}
@media (min-width: 768px) { .yp-hero__cta { bottom: 28px; } }
.yp-hero .sharebtnretret, .yp-badge-ok {
  display: inline-grid !important; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ok); color: #fff; box-shadow: 0 6px 18px -6px rgba(34, 197, 94, .8);
}
.yp-hero .sharebtnretret:empty { display: none !important; }

/* ---------- Sections & rails --------------------------------------------- */
.yp-section { padding-top: 28px; }
@media (min-width: 992px) { .yp-section { padding-top: 40px; } }
.yp-section--flush { padding-top: 0; margin-bottom: 24px; }
.yp-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.yp-section__title { position: relative; font-size: 19px; padding-inline-start: 14px; }
.yp-section__title::before { content: ""; position: absolute; inset-inline-start: 0; top: 15%; bottom: 15%; width: 4px; border-radius: 4px; background: var(--grad); }
@media (min-width: 768px) { .yp-section__title { font-size: 22px; } }
.yp-section__tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.yp-link-more { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; }
.yp-link-more:hover { color: #fff; background: var(--surface); }
[dir="rtl"] .yp-link-more .fa, [dir="rtl"] .yp-link-more svg,
[dir="rtl"] .yp-mini__go { transform: scaleX(-1); }

.yp-rail-btn {
  display: none; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .2s, opacity .2s;
}
.yp-rail-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.yp-rail-btn:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (min-width: 768px) { .yp-rail-btn { display: inline-grid; place-items: center; } }
[dir="rtl"] .yp-rail-btn .fa, [dir="rtl"] .yp-rail-btn svg { transform: scaleX(-1); }

.yp-rail {
  --cols: 2.25;
  --gap: 12px;
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--gap) * (var(--cols) - 1))) / var(--cols));
  gap: var(--gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px;
}
.yp-rail::-webkit-scrollbar { display: none; }
.yp-rail > * { scroll-snap-align: start; min-width: 0; }
@media (min-width: 576px)  { .yp-rail { --cols: 3.2; } }
@media (min-width: 768px)  { .yp-rail { --cols: 4; --gap: 16px; } }
@media (min-width: 1200px) { .yp-rail { --cols: 5; --gap: 18px; } }
@media (min-width: 1440px) { .yp-rail { --cols: 6; } }
.yp-rail--wide { --cols: 1.25; }
@media (min-width: 576px)  { .yp-rail--wide { --cols: 2.1; } }
@media (min-width: 992px)  { .yp-rail--wide { --cols: 3; } }
@media (min-width: 1440px) { .yp-rail--wide { --cols: 4; } }

/* Game card */
.yp-card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
  -webkit-tap-highlight-color: transparent;
}
.yp-card:hover, .yp-card:focus-visible { transform: translateY(-4px); border-color: rgba(139, 92, 246, .5); box-shadow: var(--shadow-glow); }
.yp-card__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.yp-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.yp-card:hover .yp-card__media img { transform: scale(1.07); }
.yp-card__body { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.yp-card__title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.yp-card__play { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: #fff; font-size: 11px; transition: background .2s; }
.yp-card:hover .yp-card__play { background: var(--grad); }
@media (min-width: 768px) { .yp-card__title { font-size: 14.5px; } .yp-card__body { padding: 12px 14px; } }

/* ---------- Page scaffolding -------------------------------------------- */
.yp-page { padding-top: 24px; padding-bottom: 16px; }
@media (min-width: 992px) { .yp-page { padding-top: 36px; } }
.yp-page--narrow { max-width: 860px; }
.yp-page--auth { max-width: 460px; padding-top: 48px; }
.yp-page__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.yp-page__title { font-size: 24px; }
@media (min-width: 768px) { .yp-page__title { font-size: 30px; } }

.yp-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px)  { .yp-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; } }
@media (min-width: 1200px) { .yp-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.yp-layout__main { min-width: 0; display: grid; gap: 24px; align-content: start; }
.yp-layout__side { min-width: 0; }
@media (min-width: 992px) { .yp-layout__side .yp-panel { position: sticky; top: calc(var(--header-h) + 72px); } }

.yp-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 576px)  { .yp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px)  { .yp-grid { gap: 16px; } }
@media (min-width: 1200px) { .yp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }

.yp-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
@media (min-width: 768px) { .yp-panel { padding: 26px; } }
.yp-panel__title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 16px; }
.yp-panel__title .fa, .yp-panel__title svg { color: var(--accent-2); }

.yp-empty { display: grid; justify-items: center; gap: 12px; padding: 56px 20px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--muted); }
.yp-empty > .fa, .yp-empty > svg { font-size: 40px; color: var(--faint); }

/* Popular list (sidebar) */
.yp-mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.yp-mini { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); transition: background .2s; }
.yp-mini:hover { background: var(--surface-2); }
.yp-mini__img { flex-shrink: 0; width: 64px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.yp-mini__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yp-mini__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yp-mini__go { color: var(--faint); }
@media (min-width: 576px) and (max-width: 991px) { .yp-mini-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Game details ------------------------------------------------- */
.yp-shot { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); border: 1px solid var(--border); }
.yp-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.yp-shot:hover img { transform: scale(1.05); }
.yp-shot__icon { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: rgba(11, 11, 24, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; font-size: 18px; border: 1px solid var(--border-strong); transition: background .2s; }
.yp-shot:hover .yp-shot__icon { background: var(--accent); }

.yp-prose { color: #d4d4e6; font-size: 15px; line-height: 1.75; }
.yp-prose p:last-child { margin-bottom: 0; }
.yp-prose img { border-radius: var(--radius-sm); }

.yp-share { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.yp-share__label { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.yp-share__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Leaderboard */
.yp-board__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.yp-board__head .yp-panel__title { margin: 0; }
.yp-board__me { display: grid; justify-items: end; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.2; }
.yp-board__me small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.yp-board__me strong { font-size: 20px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.yp-podium { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; }
.yp-podium__item { display: grid; justify-items: center; gap: 6px; padding: 16px 6px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); text-align: center; min-width: 0; }
.yp-podium__item--first { padding-top: 24px; padding-bottom: 22px; background: linear-gradient(180deg, rgba(251, 191, 36, .16), var(--surface-2)); border-color: rgba(251, 191, 36, .35); }
.yp-podium__avatar { position: relative; width: 56px; height: 56px; }
.yp-podium__item--first .yp-podium__avatar { width: 72px; height: 72px; }
.yp-podium__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--silver); background: var(--surface-3); }
.yp-podium__item--first .yp-podium__avatar img { border-color: var(--gold); }
.yp-podium__item--third .yp-podium__avatar img { border-color: var(--bronze); }
.yp-podium__avatar b { position: absolute; bottom: -4px; inset-inline-end: -4px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; color: #111; background: var(--silver); }
.yp-podium__item--first .yp-podium__avatar b { background: var(--gold); }
.yp-podium__item--third .yp-podium__avatar b { background: var(--bronze); }
.yp-podium__name { max-width: 100%; font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yp-podium__score { font-size: 16px; font-weight: 700; }
@media (min-width: 576px) { .yp-podium { gap: 14px; } .yp-podium__name { font-size: 13px; } }

.yp-ranks { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.yp-ranks:not(.active) .yp-rank:nth-child(n+4) { display: none; }
.yp-rank { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
.yp-rank__pos { width: 26px; text-align: center; color: var(--faint); font-weight: 700; }
.yp-rank__avatar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; background: var(--surface-3); }
.yp-rank__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.yp-rank__score { font-weight: 700; }

.yp-challenge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(139, 92, 246, .15), rgba(236, 72, 153, .12)); border: 1px solid rgba(139, 92, 246, .3); font-weight: 600; }
.yp-challenge .fa, .yp-challenge > span svg { color: var(--gold); }

/* ---------- Forms --------------------------------------------------------- */
.yp-form { display: grid; gap: 14px; }
.yp-form__title { font-size: 18px; margin-bottom: 2px; }
.yp-form__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 0; font-size: 13px; }
.yp-form__links a { color: var(--muted); }
.yp-form__links a:hover { color: var(--accent-3); }
.yp-form__actions { display: flex; justify-content: flex-end; margin-top: 6px; }
@media (max-width: 575px) { .yp-form__actions .yp-btn { width: 100%; } }
.yp-form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 576px) { .yp-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .yp-field--full { grid-column: 1 / -1; } }

.yp-field { display: grid; gap: 6px; margin: 0; font-weight: 400; }
.yp-field__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.yp-field .required { color: var(--accent-2); }
.yp-input,
.yp-form input[type=text], .yp-form input[type=password], .yp-form input[type=email], .yp-form input[type=tel], .yp-form textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text);
  font: 400 16px/1.4 var(--font); /* 16px stops iOS zoom-on-focus */
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.yp-lang-ar .yp-input { font-family: var(--font-ar); }
.yp-input::placeholder { color: var(--faint); }
.yp-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px rgba(139, 92, 246, .2); }
.yp-input.error { border-color: var(--danger); }
.yp-input--static { display: flex; align-items: center; background: var(--surface-2); border-style: dashed; font-weight: 600; }
.yp-form .error:not(input) { display: block; color: #fda4af; font-size: 12.5px; font-weight: 500; margin: 2px 0 0; }

.yp-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 400; color: var(--muted); cursor: pointer; margin: 0; }
.yp-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

.yp-file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.yp-file-row__preview img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-strong); display: block; }
.yp-file { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-weight: 400; }
.yp-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.yp-file__name { color: var(--muted); font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.yp-auth__icon { justify-self: center; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--grad); font-size: 22px; box-shadow: var(--shadow-glow); }

/* ---------- Profile hero ------------------------------------------------ */
.yp-profile-hero { padding: 28px 0 0; }
.yp-profile-hero__inner { display: flex; align-items: center; gap: 18px; }
.yp-profile-hero__inner > div { min-width: 0; }
.yp-profile-hero__avatar { flex-shrink: 0; width: 84px; height: 84px; border-radius: 50%; padding: 3px; background: var(--grad); box-shadow: var(--shadow-glow); }
.yp-profile-hero__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); display: block; background: var(--surface-2); }
.yp-profile-hero__hello { margin: 0; color: var(--muted); }
.yp-profile-hero__name { font-size: 26px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 768px) { .yp-profile-hero__avatar { width: 108px; height: 108px; } .yp-profile-hero__name { font-size: 34px; } }

/* ---------- Modals (Bootstrap 3) ---------------------------------------- */
.modal-backdrop.in { opacity: .7; background: #05050d; }
.yp-modal .modal-dialog { margin: 72px auto 24px; padding: 0 16px; width: auto; max-width: 400px; }
.yp-modal .modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.yp-modal .modal-header { display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse; padding: 18px 20px 6px; border: 0; }
.yp-modal .modal-header::before, .yp-modal .modal-header::after { display: none; }
.yp-modal .modal-title { font-size: 19px; font-weight: 700; }
.yp-modal .close { float: none; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--text); opacity: 1; text-shadow: none; font-size: 22px; line-height: 1; }
.yp-modal .close:hover { background: var(--surface-3); color: #fff; }
.yp-modal .modal-body { padding: 14px 20px 22px; }
.yp-modal--alert .modal-header { justify-content: flex-start; }
.yp-modal--alert .modal-body { text-align: center; font-size: 15px; }
.yp-modal--alert .modal-body p { margin: 0; }
.yp-modal--alert .success_message:not(:empty)::before,
.yp-modal--alert .error_message:not(:empty)::before,
.yp-modal--alert .warning_message:not(:empty)::before { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; font-weight: 700; font-size: 24px; }
.yp-modal--alert .success_message:not(:empty)::before { content: "\2713"; background: rgba(34, 197, 94, .18); color: var(--ok); }
.yp-modal--alert .error_message:not(:empty)::before   { content: "!"; background: rgba(244, 63, 94, .18); color: var(--danger); }
.yp-modal--alert .warning_message:not(:empty)::before { content: "!"; background: rgba(251, 191, 36, .18); color: var(--gold); }
.yp-modal--alert .success_message, .yp-modal--alert .error_message, .yp-modal--alert .warning_message { display: block; }
@media (max-width: 575px) {
  .yp-modal.fade .modal-dialog { transform: translateY(24px); }
  .yp-modal.in .modal-dialog { transform: none; }
}

/* ---------- Footer -------------------------------------------------------- */
.yp-footer { margin-top: 48px; padding: 40px 0 calc(24px + env(safe-area-inset-bottom)); background: var(--bg-2); border-top: 1px solid var(--border); color: var(--muted); }
.yp-footer__grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .yp-footer__grid { grid-template-columns: 1.4fr 1.6fr 1fr; gap: 40px; } }
.yp-footer__tag { margin: 14px 0 16px; max-width: 360px; font-size: 14px; }
.yp-footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-bottom: 14px; }
.yp-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.yp-footer__col:nth-child(2) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.yp-footer ul a { color: var(--muted); font-size: 14px; }
.yp-footer ul a:hover { color: #fff; }
.yp-social { display: flex; gap: 10px; }
.yp-social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: background .2s, transform .2s; }
.yp-social a:hover { background: var(--grad); transform: translateY(-2px); border-color: transparent; }
.yp-footer__copy { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; text-align: center; color: var(--faint); }
.yp-footer__copy p { margin: 0; }
.yp-footer__copy a { color: var(--muted); }

/* ---------- Third-party tweaks ------------------------------------------ */
.mfp-bg { background: #05050d; opacity: .92; }
.mfp-figure figure img { border-radius: 12px; }
.sharethis-inline-share-buttons { min-height: 0; }

/* ---------- Motion preferences ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.yp-board__empty { margin: 0 0 4px; padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
