/* =========================================================
   Next Star — Design System
   خطوط محلية (Tajawal + IBM Plex Sans Arabic) — بدون أي طلب خارجي
   ========================================================= */

:root {
  /* surfaces */
  --bg: #05070b;
  --bg-soft: #080b11;
  --surface: #0b1017;
  --surface-2: #101620;
  --surface-3: #161f2c;
  --panel: #0c1118;

  /* lines */
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);

  /* ink */
  --text: #f2f6fc;
  --text-2: #ccd6e4;
  --muted: #94a5bb;
  --dim: #71819a;

  /* brand */
  --gold: #ffc63f;
  --gold-2: #ffe08a;
  --orange: #ff8a2b;
  --green: #35d68a;
  --red: #ff6262;
  --blue: #5aa2ff;

  /* effects */
  --ring: 0 0 0 3px rgba(255, 198, 63, 0.18);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 8px 20px -14px rgba(0, 0, 0, 0.9);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 50px -34px rgba(0, 0, 0, 1);
  --glow-gold: 0 12px 30px -12px rgba(255, 198, 63, 0.5);

  /* geometry */
  --r-xs: 8px;
  --r-sm: 11px;
  --r: 14px;
  --radius: 18px;
  --r-lg: 22px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --fast: 0.16s var(--ease);

  /* type */
  --font-display: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Tajawal', 'Segoe UI', system-ui, sans-serif;

  /* sticky/safe */
  --pad: 24px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(255, 198, 63, 0.05), transparent 68%),
    radial-gradient(900px 500px at 4% 104%, rgba(90, 162, 255, 0.055), transparent 70%),
    linear-gradient(180deg, #070a10 0%, var(--bg) 42%, #04060a 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.3px;
}

p {
  margin: 0 0 10px;
}

img {
  max-width: 100%;
}

a {
  color: var(--gold-2);
}

::selection {
  background: rgba(255, 198, 63, 0.3);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ambient light */
.glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.8;
}

.glow-a {
  inset: -220px -160px auto auto;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at center, rgba(255, 198, 63, 0.14), transparent 62%);
}

.glow-b {
  inset: auto auto -260px -180px;
  width: 680px;
  height: 680px;
  background: radial-gradient(circle at center, rgba(90, 162, 255, 0.1), transparent 64%);
}

/* thin scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 999px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #253348;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--pad) + var(--sat)) var(--pad) calc(60px + var(--sab));
}

/* =========================================================
   Hero banner
   ========================================================= */
.hero {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 190px;
  aspect-ratio: 2000 / 667;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 198, 63, 0.22);
  background:
    radial-gradient(120% 160% at 85% -20%, rgba(255, 198, 63, 0.28), transparent 55%),
    radial-gradient(100% 150% at 0% 120%, rgba(255, 138, 43, 0.18), transparent 60%),
    linear-gradient(135deg, #11100a 0%, #0a0f16 55%, #06090e 100%);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
  margin-bottom: 22px;
  isolation: isolate;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 14px
  );
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
  background: #06090e;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 20px;
  z-index: 0;
}

.hero.is-loaded .hero-fallback {
  display: none;
}

.hero-kicker {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 224, 138, 0.7);
  font-weight: 700;
  direction: ltr;
}

.hero-name {
  width: min(68%, 420px);
  height: auto;
  filter: drop-shadow(0 10px 26px rgba(255, 198, 63, 0.25));
}

.hero-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* هالة ذهبية بتتنفّس حوالين البانر */
.hero.is-loaded {
  animation: heroGlow 6.5s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.4) inset, 0 10px 30px -20px rgba(255, 198, 63, 0);
  }
  to {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.4) inset,
      0 20px 60px -18px rgba(255, 198, 63, 0.5), 0 0 40px -6px rgba(255, 198, 63, 0.35);
  }
}

/* ضوء ذهبي بيلفّ حوالين إطار البانر (مش محتاج صور) */
@property --hero-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 5;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--hero-angle),
    rgba(255, 214, 102, 0) 0deg,
    rgba(255, 214, 102, 0) 236deg,
    rgba(255, 241, 190, 0.95) 292deg,
    rgba(255, 214, 102, 0) 344deg,
    rgba(255, 214, 102, 0) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: heroRim 9s linear infinite;
}

@keyframes heroRim {
  to {
    --hero-angle: 360deg;
  }
}

/* =========================================================
   Hero motion — حركة هادئة على البانر (transform/opacity فقط)
   ========================================================= */
.hero {
  --rise: 150px;
}

/* كشف ناعم عند التحميل + حركة كين برنز بطيئة */
.hero.is-loaded .hero-media img {
  animation: heroReveal 0.95s cubic-bezier(0.22, 0.61, 0.36, 1) both,
    heroDrift 30s 1.2s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: scale(1.12);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1.03);
    filter: blur(0);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.03) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.075) translate3d(-0.9%, -0.6%, 0);
  }
}

/* لمعة ضوء تعبر البانر كل شوية */
.hero-sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.hero-sheen::before {
  content: '';
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: 0;
  width: 34%;
  background: linear-gradient(
    90deg,
    rgba(255, 246, 216, 0) 0%,
    rgba(255, 246, 216, 0.1) 32%,
    rgba(255, 251, 235, 0.42) 50%,
    rgba(255, 246, 216, 0.1) 68%,
    rgba(255, 246, 216, 0) 100%
  );
  filter: blur(6px);
  mix-blend-mode: screen;
  transform: translateX(320%) skewX(-14deg);
  animation: heroSheen 6.8s 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes heroSheen {
  0% {
    transform: translateX(320%) skewX(-14deg);
  }
  46%,
  100% {
    transform: translateX(-180%) skewX(-14deg);
  }
}

/* شرارات ذهبية خفيفة تطلع لفوق */
.hero-sparks {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.hero-sparks i {
  position: absolute;
  bottom: -8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe9a8;
  box-shadow: 0 0 10px 2px rgba(255, 198, 63, 0.55);
  opacity: 0;
  animation: heroSpark 11s linear infinite;
}

.hero-sparks i:nth-child(1) {
  left: 14%;
  animation-delay: 0.6s;
  animation-duration: 9.5s;
}

.hero-sparks i:nth-child(2) {
  left: 31%;
  animation-delay: 3.4s;
  animation-duration: 12.5s;
  width: 3px;
  height: 3px;
}

.hero-sparks i:nth-child(3) {
  left: 52%;
  animation-delay: 6.1s;
  animation-duration: 10.5s;
}

.hero-sparks i:nth-child(4) {
  left: 70%;
  animation-delay: 1.8s;
  animation-duration: 13s;
  width: 3px;
  height: 3px;
}

.hero-sparks i:nth-child(5) {
  left: 86%;
  animation-delay: 8.2s;
  animation-duration: 11.5s;
}

@keyframes heroSpark {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.5);
  }
  12% {
    opacity: 0.85;
  }
  70% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: translate3d(6px, calc(var(--rise) * -1), 0) scale(1.1);
  }
}

@media (min-width: 721px) {
  .hero {
    --rise: 340px;
  }
}

/* =========================================================
   Header
   ========================================================= */
header.site {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  height: 48px;
  width: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(255, 198, 63, 0.18));
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  height: 30px;
  width: auto;
  max-width: 100%;
}

.brand-sub {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.head-actions {
  margin-inline-start: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 12px 24px;
  color: #17100a;
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 60%, #f0a51d);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, var(--glow-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--fast), box-shadow var(--fast), background var(--fast),
    border-color var(--fast), color var(--fast);
  line-height: 1.4;
  min-height: 44px;
  touch-action: manipulation;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 16px 34px -14px rgba(255, 198, 63, 0.62);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  border: 1px solid var(--line-2);
  box-shadow: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-3);
  color: var(--text);
  box-shadow: none;
}

.btn.soft {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  color: var(--text);
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
}

.btn.soft:hover {
  border-color: rgba(255, 198, 63, 0.45);
  color: var(--gold-2);
}

.btn.sm {
  padding: 9px 15px;
  font-size: 13px;
  min-height: 38px;
}

.btn.tiny {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  min-height: 34px;
}

.btn.danger {
  color: #ffb3b3;
  border-color: rgba(255, 98, 98, 0.35);
}

.btn.danger:hover {
  color: #ffd0d0;
  border-color: rgba(255, 98, 98, 0.6);
  background: rgba(255, 98, 98, 0.08);
}

.btn .ic {
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 11px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: var(--fast);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn .ic {
  width: 17px;
  height: 17px;
}

/* =========================================================
   Cards
   ========================================================= */
.card {
  position: relative;
  background: linear-gradient(180deg, #0d131c 0%, #0a0f16 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
}

.card-head h2 {
  font-size: 17.5px;
}

.card-ic {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(255, 198, 63, 0.09);
  border: 1px solid rgba(255, 198, 63, 0.2);
  color: var(--gold-2);
}

.card-ic .ic {
  width: 16px;
  height: 16px;
}

.card-head .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 198, 63, 0.12);
}

.card-head .sub {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.spacer {
  flex: 1;
}

/* =========================================================
   Form
   ========================================================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.field label,
.label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

input,
select,
textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: #070b11;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
  line-height: 1.6;
  min-height: 46px;
}

textarea {
  resize: vertical;
  min-height: 130px;
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-3);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(255, 198, 63, 0.65);
  box-shadow: var(--ring);
  background: #080d14;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 21px) calc(50% + 1px), calc(100% - 16px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 40px;
  cursor: pointer;
}

input[type='checkbox'],
input[type='radio'] {
  width: auto;
  min-height: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.key-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.key-row input {
  flex: 1;
  min-width: 0;
}

.key-row .icon-btn {
  height: auto;
  min-height: 46px;
}

.search {
  padding: 10px 14px;
  min-height: 40px;
  font-size: 13.5px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 14px;
}

/* =========================================================
   Output
   ========================================================= */
.out {
  position: relative;
  background: #080c12;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.out:last-child {
  margin-bottom: 0;
}

.out-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--gold);
  margin-bottom: 5px;
}

.title-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.title-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #080c12;
  border: 1px solid var(--line);
  border-inline-start: 2px solid var(--gold);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--text-2);
  transition: var(--fast);
}

.title-list li:hover {
  border-color: var(--line-2);
  border-inline-start-color: var(--gold-2);
}

.title-list li .num {
  flex: 0 0 auto;
  color: var(--gold);
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 198, 63, 0.08);
  border: 1px solid rgba(255, 198, 63, 0.22);
  color: var(--gold-2);
}

.note-list,
.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-list li,
.plain-list li {
  display: flex;
  gap: 9px;
  font-size: 13.8px;
  color: var(--text-2);
  align-items: flex-start;
  line-height: 1.75;
}

.note-list li::before {
  content: '';
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 198, 63, 0.12);
}

.plain-list li::before {
  content: '';
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin-top: 9px;
  border-radius: 2px;
  background: var(--line-3);
}

.note-list li span,
.plain-list li span {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  margin-inline-end: 6px;
  margin-bottom: 6px;
}

.pill.gold {
  background: rgba(255, 198, 63, 0.1);
  border-color: rgba(255, 198, 63, 0.28);
  color: var(--gold-2);
}

.muted {
  color: var(--muted);
  font-size: 12.5px;
}

/* =========================================================
   Empty / errors
   ========================================================= */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 52px 24px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.012);
}

.empty .big {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--gold);
}

.empty .big .ic {
  width: 24px;
  height: 24px;
  animation: spin 1.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   Tracker / bars
   ========================================================= */
.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 8px;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  box-shadow: 0 0 14px rgba(255, 198, 63, 0.5);
  transition: width 0.5s var(--ease);
}

.track-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Notice boxes
   ========================================================= */
.warn {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  background: linear-gradient(100deg, rgba(255, 138, 43, 0.1), rgba(255, 138, 43, 0.03));
  border: 1px solid rgba(255, 138, 43, 0.28);
  border-radius: var(--r);
  padding: 13px 16px;
  font-size: 13px;
  color: #ffcfae;
  line-height: 1.8;
}

.warn strong {
  color: #ffb27d;
  font-weight: 700;
}

.hint-box {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.85;
}

.hint-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-display);
}

.hint-box a {
  color: var(--gold-2);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 198, 63, 0.35);
}

.hint-box a:hover {
  border-bottom-color: var(--gold-2);
}

.banner-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: rgba(255, 198, 63, 0.1);
  border: 1px solid rgba(255, 198, 63, 0.25);
  color: var(--gold-2);
}

.banner-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.banner-txt strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.banner-txt span {
  font-size: 12.5px;
  color: #cbb9a8;
  line-height: 1.6;
}

.banner.demo {
  background: linear-gradient(100deg, rgba(90, 162, 255, 0.12), rgba(90, 162, 255, 0.03));
  border-color: rgba(90, 162, 255, 0.3);
}

.banner.demo .banner-ic {
  background: rgba(90, 162, 255, 0.12);
  border-color: rgba(90, 162, 255, 0.3);
  color: #9dc4ff;
}

.banner.demo .banner-txt span {
  color: #b9c9dd;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.8;
}

.site-footer p {
  margin: 0 0 4px;
}

.foot-logo {
  width: 34px;
  height: auto;
  margin-bottom: 8px;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(255, 198, 63, 0.14));
}

/* =========================================================
   Toast
   ========================================================= */
#toast {
  position: fixed;
  inset-inline: 0;
  bottom: calc(26px + var(--sab));
  margin: 0 auto;
  width: max-content;
  max-width: min(92vw, 460px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #3ae494, var(--green));
  color: #05230f;
  font-weight: 700;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 18px 40px -14px rgba(53, 214, 138, 0.6), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: 0.24s var(--ease);
  z-index: 120;
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* =========================================================
   Icons
   ========================================================= */
.ic {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  vertical-align: -3px;
  display: inline-block;
}

.ic-fill {
  stroke: none;
}

.ic-sm {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}

.ic-in {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  opacity: 0.65;
  margin-inline-end: 5px;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 720px) {
  :root {
    --pad: 16px;
  }

  .hero {
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .brand-logo {
    height: 42px;
  }

  .brand-name {
    height: 26px;
  }

  header.site {
    gap: 12px;
  }

  .head-actions {
    width: 100%;
    margin-inline-start: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .head-actions .btn {
    width: 100%;
    padding: 10px 10px;
    font-size: 12.5px;
  }

  /* زر المهمة الجديدة أساسي — ياخد صف كامل على الموبايل */
  .head-actions #newMission {
    grid-column: 1 / -1;
  }

  .card {
    padding: 16px 15px;
    border-radius: 15px;
  }

  /* منع تكبير iOS التلقائي عند الكتابة */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .btn {
    padding-inline: 18px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14.5px;
  }

  .card-head {
    gap: 9px;
  }

  .card-head h2 {
    font-size: 16px;
  }

  .banner {
    padding: 11px 13px;
  }
}

@media (hover: none) {
  .btn:hover {
    transform: none;
  }
}

/* شريط الخطوات في المقاسات المتوسطة: نكبّر مساحة الاسم بدل ما يتقص */
@media (min-width: 761px) and (max-width: 1120px) {
  .step-btn {
    gap: 7px;
    padding: 9px 10px;
    font-size: 12.5px;
  }

  .step-btn .t .ic-step {
    display: none;
  }

  .step-btn .n {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* صورة مبتورة/مش موجودة: نخفي المكسورة ونبين البديل */
.hero.is-missing img {
  display: none;
}

.hero.is-missing {
  min-height: 170px;
}

/* كلمة STAR لازم تاخد نفس تدرّج اللون — النص الشفاف بيورث */
.hero-fallback strong em {
  -webkit-text-fill-color: transparent;
  background: linear-gradient(100deg, var(--gold-2), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
}

/* لما البانر يتحمّل، الارتفاع يبقى حسب الصورة نفسها */
.hero.is-loaded {
  min-height: 0;
}

@media (max-width: 720px) {
  #startAnalyze {
    width: 100%;
  }
}

/* لو الجهاز بيقلّل الحركة: نلغي الزووم واللمعة والشرارات ونسيب ظهور ناعم */
@media (prefers-reduced-motion: reduce) {
  .hero.is-loaded .hero-media img {
    animation-name: heroFade !important;
    animation-duration: 0.5s !important;
    animation-timing-function: ease !important;
    animation-fill-mode: both !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }

  .hero-sheen::before {
    display: none !important;
  }

  .hero-sparks {
    display: none !important;
  }

  .hero::before {
    animation: none !important;
  }

  .hero.is-loaded {
    animation: none !important;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.4) inset,
      0 18px 50px -22px rgba(255, 198, 63, 0.32);
  }
}

@keyframes heroFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =========================================================
   مفتاح الحركة — بيتغلّب على إعداد «تقليل الحركة» لو المستخدم شغّله
   ========================================================= */
html[data-motion='on'] .hero.is-loaded .hero-media img {
  animation: heroReveal 0.95s cubic-bezier(0.22, 0.61, 0.36, 1) both,
    heroDrift 30s 1.2s ease-in-out infinite alternate !important;
}

html[data-motion='on'] .hero.is-loaded {
  animation: heroGlow 6.5s ease-in-out infinite alternate !important;
}

html[data-motion='on'] .hero::before {
  animation: heroRim 9s linear infinite !important;
}

html[data-motion='on'] .hero-sheen::before {
  display: block !important;
  animation: heroSheen 6.8s 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

html[data-motion='on'] .hero-sparks {
  display: block !important;
}

html[data-motion='on'] .hero-sparks i {
  animation-name: heroSpark !important;
  animation-duration: 11s !important;
  animation-iteration-count: infinite !important;
  animation-timing-function: linear !important;
  opacity: 0;
}

/* لو المستخدم قفل الحركة من الإعدادات: سكون كامل */
html[data-motion='off'] .hero.is-loaded,
html[data-motion='off'] .hero::before,
html[data-motion='off'] .hero-sheen::before,
html[data-motion='off'] .hero.is-loaded .hero-media img {
  animation: none !important;
}

html[data-motion='off'] .hero-sparks {
  display: none !important;
}

/* =========================================================
   Publishing readiness — legal pages, skip link, update banner
   ========================================================= */
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -70px;
  z-index: 9999;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1200;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  transition: top var(--fast);
}
.skip-link:focus {
  top: calc(12px + var(--sat));
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 8px;
}
.foot-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.foot-links a img {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
}
.foot-links a[hidden] {
  display: none !important;
}
.contact-discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.contact-discord img {
  width: 18px;
  height: 18px;
  display: block;
}
.contact-discord:hover,
.contact-discord:focus-visible {
  color: var(--gold-2);
  border-bottom-color: currentColor;
}
.foot-links a:hover,
.foot-links a:focus-visible {
  color: var(--gold-2);
  border-bottom-color: currentColor;
}

/* ---------- Legal / static pages ---------- */
.legal-body {
  min-height: 100vh;
  min-height: 100dvh;
}
.legal-wrap {
  max-width: 860px;
  padding-top: calc(28px + var(--sat));
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
}
.back-link:hover,
.back-link:focus-visible {
  color: var(--gold-2);
}
.legal {
  padding: clamp(20px, 4vw, 40px);
}
.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.3;
  margin: 0 0 6px;
}
.legal h2 {
  font-family: var(--font-display);
  font-size: clamp(17px, 3vw, 21px);
  margin: 30px 0 8px;
  color: var(--gold-2);
}
.legal p,
.legal li {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.95;
}
.legal ul {
  padding-inline-start: 20px;
  margin: 8px 0 12px;
}
.legal li {
  margin-bottom: 6px;
}
.legal-meta {
  color: var(--dim) !important;
  font-size: 12.5px !important;
  margin: 0 0 18px;
}
.legal-code {
  font-family: var(--font-display);
  font-size: clamp(56px, 14vw, 92px);
  font-weight: 900;
  line-height: 1;
  color: var(--gold);
  margin: 4px 0 6px;
}
.legal-logo {
  width: 84px;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 8px 22px rgba(255, 198, 63, 0.2));
}
.centered {
  text-align: center;
}
.legal-footer {
  margin-top: 20px;
}
.legal-footer .foot-links {
  justify-content: center;
}

/* ---------- Update banner ---------- */
.banner.update {
  border-color: rgba(90, 162, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(90, 162, 255, 0.08), rgba(90, 162, 255, 0.03)),
    var(--surface);
}
.banner.update .banner-ic {
  background: rgba(90, 162, 255, 0.12);
  border-color: rgba(90, 162, 255, 0.32);
  color: var(--blue);
}

/* ---------- Mission search ---------- */
.mission-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mission-tools .search {
  flex: 1;
  min-width: 0;
}
.mission-empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- Loading / cancel ---------- */
.loading-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

/* ---------- Mobile touch targets ---------- */
@media (max-width: 720px) {
  .btn,
  .chip,
  .step-btn {
    min-height: 44px;
  }
  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .foot-links {
    justify-content: center;
  }
  .legal-wrap {
    padding-inline: 16px;
  }
}

/* =========================================================
   Mobile performance — البانر الثقيل يتخفّف على الشاشات الصغيرة
   (الحفاظ على الشكل بدون conic-gradient متحرك أو ظل متحرك)
   ========================================================= */
@media (max-width: 720px) {
  .hero.is-loaded {
    animation: none;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
  }
  .hero::before {
    animation: none;
    opacity: 0.55;
  }
  .hero-media img {
    animation: none !important;
    transform: none;
  }
  .hero-sheen,
  .hero-sparks {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before {
    animation: none !important;
  }
}
