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

html, body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-arabic);
  background: linear-gradient(180deg, var(--bg-start), var(--bg-end) 70%);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 2.5s ease;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* خلفية ديناميكية حسب فترة الصلاة الحالية (theme.js يضبط data-period على html) */
html[data-period="fajr"] body { background: linear-gradient(180deg, #101E33, var(--bg-end) 70%); }
html[data-period="dhuhr"] body { background: linear-gradient(180deg, #1E1B24, var(--bg-end) 70%); }
html[data-period="asr"] body { background: linear-gradient(180deg, #0E2033, var(--bg-end) 70%); }
html[data-period="maghrib"] body { background: linear-gradient(180deg, #2A160F, var(--bg-end) 70%); }
html[data-period="isha"] body { background: linear-gradient(180deg, #070B14, var(--bg-end) 70%); }

/* الوضع الفاتح يتجاوز خلفيات فترات الصلاة (خصوصية أعلى: خاصيتان بدل واحدة) — خلفية فاتحة ثابتة بدل التلوين حسب الفترة */
html[data-theme="light"][data-period] body { background: linear-gradient(180deg, var(--bg-start), var(--bg-end) 70%); }

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/ibm-plex-sans-arabic-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/ibm-plex-sans-arabic-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/ibm-plex-sans-arabic-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/ibm-plex-sans-arabic-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* أرقام آمنة لـ RTL — عبر format.js دائماً */
.num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

svg.icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

/* زخرفة الهندسة المقدسة — طبقة خلفية ثابتة بشفافية خفيفة جداً */
.sacred-geometry-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url('../assets/pattern-sacred-geometry.svg');
  background-repeat: repeat;
  background-size: 120px 120px;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin-inline: auto;
  min-height: 100dvh;
}

@media (min-width: 600px) {
  body {
    background-attachment: fixed;
  }
  #app {
    box-shadow: 0 0 60px rgba(0,0,0,.4);
  }
}
