/* =========================================================
   Quran Karim — Premium PWA
   Glassmorphism + Galaxy/Sky themes + RTL
   ========================================================= */

:root {
  --radius: 18px;
  --radius-sm: 12px;
  --nav-height: 76px;
  --player-height: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-ui: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --font-ar: 'Amiri Quran', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Theme: Dark (Galaxy) ---------- */
[data-theme="dark"] {
  --bg-1: #060b18;
  --bg-2: #0b1530;
  --text: #eef3ff;
  --text-dim: #9bb0d6;
  --accent: #ffcf6b;
  --accent-2: #6ee3c9;
  --danger: #ff6b6b;
  --success: #5fe39b;
  --glass-bg: rgba(255,255,255,.06);
  --glass-bg-strong: rgba(255,255,255,.10);
  --glass-border: rgba(255,255,255,.12);
  --glass-shadow: 0 12px 40px rgba(0,0,0,.45);
  --ink-shadow: 0 1px 0 rgba(0,0,0,.4);
}

/* ---------- Theme: Light (Sky) ---------- */
[data-theme="light"] {
  --bg-1: #e8f3ff;
  --bg-2: #cfe8ff;
  --text: #16314f;
  --text-dim: #5d7693;
  --accent: #c98a1e;
  --accent-2: #1f9d8a;
  --danger: #e35858;
  --success: #1f9d6e;
  --glass-bg: rgba(255,255,255,.55);
  --glass-bg-strong: rgba(255,255,255,.75);
  --glass-border: rgba(255,255,255,.6);
  --glass-shadow: 0 12px 32px rgba(60,100,160,.18);
  --ink-shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .4s var(--ease);
  -webkit-font-smoothing: antialiased;
}
img { -webkit-user-drag: none; user-select: none; }

/* =========================================================
   Animated background layers
   ========================================================= */
.bg-scene { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }

/* --- Galaxy (dark) --- */
.bg-galaxy { opacity: 0; transition: opacity .8s var(--ease); }
[data-theme="dark"] .bg-galaxy { opacity: 1; }

.stars-layer {
  position: absolute; inset: -10%;
  background-repeat: repeat;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff 99%, transparent),
    radial-gradient(1px 1px at 80% 10%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 40% 60%, #fff 99%, transparent),
    radial-gradient(1px 1px at 65% 75%, #fff 99%, transparent),
    radial-gradient(1px 1px at 25% 85%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 90% 50%, #fff 99%, transparent),
    radial-gradient(1px 1px at 50% 30%, #fff 99%, transparent),
    radial-gradient(1px 1px at 15% 45%, #fff 99%, transparent),
    radial-gradient(1px 1px at 75% 90%, #fff 99%, transparent);
  background-size: 100% 100%;
  animation: twinkle 4s ease-in-out infinite alternate;
}
.stars-layer.deep { opacity: .5; animation-duration: 6s; transform: scale(1.4); }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }

.meteor {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  filter: drop-shadow(0 0 6px #fff);
}
.meteor::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 120px; height: 1px;
  background: linear-gradient(270deg, rgba(255,255,255,.9), transparent);
  transform-origin: left center;
}
.meteor.m1 { top: 8%;  left: 70%; animation: meteor-fall 6s linear infinite; animation-delay: .5s; }
.meteor.m2 { top: 22%; left: 30%; animation: meteor-fall 8s linear infinite; animation-delay: 3s; }
.meteor.m3 { top: 4%;  left: 45%; animation: meteor-fall 7s linear infinite; animation-delay: 5.5s; }
@keyframes meteor-fall {
  0%   { transform: translate(0,0) rotate(135deg); opacity: 0; }
  6%   { opacity: 1; }
  35%  { transform: translate(-340px, 340px) rotate(135deg); opacity: 0; }
  100% { opacity: 0; }
}

/* --- Sky (light) --- */
.bg-sky { opacity: 0; transition: opacity .8s var(--ease); }
[data-theme="light"] .bg-sky { opacity: 1; }
.sun {
  position: absolute; top: 6%; right: 12%;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6cf, #ffd76b 60%, #ffc24b 100%);
  box-shadow: 0 0 80px 20px rgba(255, 210, 110, .55);
  animation: sun-pulse 6s ease-in-out infinite;
}
@keyframes sun-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.cloud {
  position: absolute;
  background: rgba(255,255,255,.85);
  border-radius: 50px;
  filter: drop-shadow(0 8px 14px rgba(120,160,210,.25));
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.cloud.c1 { width: 160px; height: 46px; top: 14%; left: -20%; animation: drift 70s linear infinite; }
.cloud.c1::before { width: 70px; height: 70px; top: -36px; left: 18px; }
.cloud.c1::after  { width: 90px; height: 90px; top: -46px; left: 70px; }
.cloud.c2 { width: 120px; height: 36px; top: 32%; left: -25%; animation: drift 95s linear infinite; animation-delay: -30s; opacity: .85; }
.cloud.c2::before { width: 50px; height: 50px; top: -26px; left: 14px; }
.cloud.c2::after  { width: 70px; height: 70px; top: -34px; left: 54px; }
.cloud.c3 { width: 200px; height: 54px; top: 55%; left: -30%; animation: drift 120s linear infinite; animation-delay: -60s; opacity: .7; }
.cloud.c3::before { width: 80px; height: 80px; top: -42px; left: 24px; }
.cloud.c3::after  { width: 110px; height: 110px; top: -56px; left: 90px; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(140vw); } }

/* =========================================================
   Glass component
   ========================================================= */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* =========================================================
   App shell
   ========================================================= */
.app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 14px calc(var(--nav-height) + var(--player-height) + var(--safe-b) + 18px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  animation: fade-in .5s var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07111f; flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; fill: currentColor; }
.brand-text h1 { font-size: 17px; margin: 0; letter-spacing: .3px; }
.brand-text span { font-size: 11px; color: var(--text-dim); }

.theme-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--accent);
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .25s var(--ease), color .3s;
}
.theme-toggle:active { transform: scale(.9) rotate(15deg); }
.theme-toggle svg { width: 22px; height: 22px; fill: currentColor; }

/* =========================================================
   Views
   ========================================================= */
.view { display: none; flex-direction: column; gap: 14px; animation: fade-in .35s var(--ease); }
.view.active { display: flex; }

.view-header { padding: 4px 6px; }
.view-header .eyebrow {
  font-size: 11px; color: var(--accent); letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; margin: 0 0 4px;
}
.view-header h2 { margin: 0; font-size: 21px; }
.view-header p { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }

/* segmented tabs */
.segmented {
  display: flex; gap: 6px; padding: 6px; border-radius: 999px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
}
.segmented button {
  flex: 1; border: none; background: transparent; color: var(--text-dim);
  padding: 10px 8px; border-radius: 999px; font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all .25s var(--ease); position: relative; overflow: hidden;
}
.segmented button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07111f; box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

/* card grid lists */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; border-radius: var(--radius-sm);
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .2s var(--ease), background .25s;
}
.list-item:active { transform: scale(.98); }
.list-item .badge {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--accent);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
}
.list-item .info { flex: 1; min-width: 0; }
.list-item .info strong { display: block; font-size: 14.5px; }
.list-item .info span { display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.list-item .chev { color: var(--text-dim); flex-shrink: 0; }
.list-item .chev svg { width: 18px; height: 18px; fill: currentColor; transform: rotate(180deg); }

.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid-3 .list-item { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 6px; }
.grid-3 .badge { font-size: 14px; }

/* search box */
.search-box { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; border-radius: 999px; }
.search-box input {
  flex: 1; border: none; background: transparent; color: var(--text);
  font-family: inherit; font-size: 14px; padding: 12px 4px; outline: none;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box .icon-btn { color: var(--text-dim); }

/* =========================================================
   Verses
   ========================================================= */
.verses-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 2px; }
.verses-header .back-btn { display: flex; align-items: center; gap: 8px; color: var(--text); background: none; border: none; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; padding: 8px; }
.verses-header .back-btn svg { width: 18px; height: 18px; fill: currentColor; }
.verses-header .title-block { text-align: center; flex: 1; }
.verses-header .title-block strong { display: block; font-size: 16px; }
.verses-header .title-block span { font-size: 11px; color: var(--text-dim); }

.verse-card {
  padding: 18px 16px; border-radius: var(--radius); position: relative;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.verse-card.is-active {
  background: var(--glass-bg-strong);
  box-shadow: 0 0 0 1.5px var(--accent), var(--glass-shadow);
}
.verse-card .verse-no {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07111f; font-size: 12px; font-weight: 800; margin-bottom: 10px;
}
.verse-card .arabic {
  font-family: var(--font-ar); direction: rtl; text-align: right;
  font-size: 26px; line-height: 2.2; color: var(--text); text-shadow: var(--ink-shadow);
}
.verse-card .translation {
  margin-top: 10px; font-size: 14px; line-height: 1.9; color: var(--text-dim);
}
.verse-card .play-mini {
  position: absolute; left: 14px; top: 14px;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--glass-border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg-strong); color: var(--accent);
}
.verse-card .play-mini svg { width: 14px; height: 14px; fill: currentColor; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  font-family: inherit; border: none; cursor: pointer; border-radius: 999px;
  position: relative; overflow: hidden; transition: transform .2s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  padding: 14px 22px; font-size: 14.5px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #07111f;
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
}
.btn-primary.full { width: 100%; }
.btn-ghost {
  padding: 12px 18px; font-size: 13.5px; font-weight: 700; color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass-bg); color: var(--text); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }

/* ripple */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); transform: scale(0); animation: ripple .6s linear; pointer-events: none; }
[data-theme="light"] .ripple { background: rgba(255,255,255,.7); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* =========================================================
   Mini Player
   ========================================================= */
.mini-player {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-height) + var(--safe-b) - 6px);
  display: flex; justify-content: center; z-index: 40;
  padding: 0 14px; pointer-events: none;
  transform: translateY(140%); transition: transform .35s var(--ease);
}
.mini-player.show { transform: translateY(0); pointer-events: auto; }
.mini-player-inner {
  width: 100%; max-width: 532px; height: var(--player-height);
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 20px;
}
.mini-player .cover {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #07111f;
  position: relative; overflow: hidden;
}
.mini-player .cover svg { width: 22px; height: 22px; fill: currentColor; }
.mini-player .cover.spinning svg { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mini-player .meta { flex: 1; min-width: 0; cursor: pointer; }
.mini-player .meta strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player .meta span { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.mini-player .progress {
  height: 3px; border-radius: 3px; background: var(--glass-border); margin-top: 6px; overflow: hidden;
}
.mini-player .progress i {
  display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .2s linear;
}
.mini-player .controls { display: flex; align-items: center; gap: 2px; }
.mini-player .controls button {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mini-player .controls button svg { width: 17px; height: 17px; fill: currentColor; }
.mini-player .controls button.play-btn {
  width: 42px; height: 42px; background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
}
.mini-player .controls button.play-btn svg { width: 18px; height: 18px; }
.mini-player .controls button.active { color: var(--accent); }

/* =========================================================
   Reciter dialog
   ========================================================= */
.dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease);
}
.dialog-overlay.show { opacity: 1; visibility: visible; }
.dialog-sheet {
  width: 100%; max-width: 560px; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(22px + var(--safe-b));
  transform: translateY(100%); transition: transform .35s var(--ease);
}
.dialog-overlay.show .dialog-sheet { transform: translateY(0); }
.dialog-sheet h3 { margin: 0 0 4px; font-size: 17px; }
.dialog-sheet p.sub { margin: 0 0 14px; font-size: 12.5px; color: var(--text-dim); }
.reciter-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.reciter-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px solid transparent; transition: all .2s var(--ease); position: relative; overflow: hidden;
  background: var(--glass-bg);
}
.reciter-item.active { border-color: var(--accent); background: var(--glass-bg-strong); }
.reciter-item img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--glass-bg-strong); }
.reciter-item span { font-size: 12px; font-weight: 700; text-align: center; }
.reciter-item small { font-size: 10px; color: var(--text-dim); }

/* =========================================================
   Tasbih
   ========================================================= */
.dhikr-card { padding: 18px; border-radius: var(--radius); }
.dhikr-card .day-tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: var(--accent);
  background: var(--glass-bg-strong); border-radius: 999px; padding: 5px 12px; margin-bottom: 10px;
}
.dhikr-card .arabic { font-family: var(--font-ar); font-size: 22px; line-height: 2.1; text-align: center; margin: 6px 0 12px; }
.dhikr-card .desc { font-size: 13.5px; line-height: 1.9; color: var(--text-dim); }
.dhikr-card .desc strong { color: var(--text); }

.tasbih-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0; }
.dhikr-select {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none;
}
.dhikr-select::-webkit-scrollbar { display: none; }
.dhikr-chip {
  flex-shrink: 0; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-dim); cursor: pointer;
  font-family: var(--font-ar);
}
.dhikr-chip.active { color: #07111f; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }

.counter-ring-wrap { position: relative; width: 230px; height: 230px; }
.counter-ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.counter-ring-wrap .track { fill: none; stroke: var(--glass-border); stroke-width: 10; }
.counter-ring-wrap .progress-ring { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .25s var(--ease); }
.counter-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.counter-center .num { font-size: 52px; font-weight: 800; line-height: 1; }
.counter-center .target { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.counter-center .phrase { font-family: var(--font-ar); font-size: 16px; margin-top: 8px; text-align: center; padding: 0 14px; }

.tap-zone {
  width: 100%; max-width: 280px; aspect-ratio: 3/1.1; border-radius: 26px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 800; color: #07111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  border: none; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .12s var(--ease);
}
.tap-zone:active { transform: scale(.96); }
.tap-zone svg { width: 22px; height: 22px; fill: currentColor; }

.plus-pop {
  position: absolute; font-size: 22px; font-weight: 800; color: var(--accent);
  pointer-events: none; animation: pop-up .8s ease-out forwards;
  left: 50%; top: 30%;
}
@keyframes pop-up {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1); }
}

.tasbih-toolbar { display: flex; gap: 10px; width: 100%; }
.tasbih-toolbar .btn-ghost { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tasbih-toolbar .btn-ghost svg { width: 16px; height: 16px; fill: currentColor; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--radius-sm); width: 100%; }
.toggle-row span { font-size: 13.5px; font-weight: 700; }
.switch { width: 46px; height: 26px; border-radius: 999px; background: var(--glass-border); position: relative; cursor: pointer; transition: background .25s; flex-shrink: 0; }
.switch.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch i { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: right .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.switch.on i { right: 23px; }

/* =========================================================
   Istikharah
   ========================================================= */
.istikharah-steps { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); }
.istikharah-steps .step { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.9; color: var(--text-dim); }
.istikharah-steps .step b {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: var(--glass-bg-strong); color: var(--accent); font-weight: 800;
}
.istikharah-steps .step strong { color: var(--text); }

.istikharah-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 8px 0; }
.istikharah-orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center; color: #07111f;
  box-shadow: 0 14px 36px rgba(0,0,0,.25);
}
.istikharah-orb svg { width: 56px; height: 56px; fill: currentColor; }
.istikharah-orb.loading { animation: pulse-spin 1.1s linear infinite; }
@keyframes pulse-spin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.08); } 100% { transform: rotate(360deg) scale(1); } }

.istikharah-result {
  width: 100%; padding: 20px; border-radius: var(--radius); text-align: center;
  animation: result-in .4s var(--ease);
  border: 1.5px solid transparent;
}
.istikharah-result.good { border-color: var(--success); background: var(--glass-bg-strong); }
.istikharah-result.bad  { border-color: var(--danger);  background: var(--glass-bg-strong); }
.istikharah-result.mid  { border-color: var(--accent);  background: var(--glass-bg-strong); }
.istikharah-result .verdict { font-size: 19px; font-weight: 800; margin-bottom: 10px; }
.istikharah-result.good .verdict { color: var(--success); }
.istikharah-result.bad  .verdict { color: var(--danger); }
.istikharah-result.mid  .verdict { color: var(--accent); }
.istikharah-result .ayah-ar { font-family: var(--font-ar); font-size: 20px; line-height: 2; margin-bottom: 10px; }
.istikharah-result .ayah-fa { font-size: 13.5px; color: var(--text-dim); line-height: 1.9; margin-bottom: 8px; }
.istikharah-result .meaning { font-size: 13px; line-height: 1.9; margin-bottom: 14px; }
.istikharah-result .ref { font-size: 11.5px; color: var(--text-dim); margin-bottom: 14px; }
.istikharah-actions { display: flex; gap: 10px; width: 100%; }
.istikharah-actions .btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.istikharah-actions .btn svg { width: 16px; height: 16px; fill: currentColor; }

@keyframes result-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* =========================================================
   Bottom nav
   ========================================================= */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center;
  padding: 10px 14px calc(10px + var(--safe-b));
}
.bottom-nav-inner {
  width: 100%; max-width: 560px; height: 60px;
  display: flex; align-items: center; justify-content: space-around;
  border-radius: 22px; padding: 0 8px;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: none; background: transparent; color: var(--text-dim); cursor: pointer;
  font-family: inherit; font-size: 10.5px; font-weight: 700; flex: 1; height: 100%;
  position: relative; border-radius: 16px; overflow: hidden;
}
.nav-item svg { width: 21px; height: 21px; fill: currentColor; transition: transform .25s var(--ease); position: relative; z-index: 1; }
.nav-item span { position: relative; z-index: 1; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { transform: translateY(-2px) scale(1.08); }
.nav-item .nav-pill {
  position: absolute; top: 4px; width: 34px; height: 34px; border-radius: 12px;
  background: var(--glass-bg-strong); opacity: 0; transform: scale(.6);
  transition: all .3s var(--ease); z-index: 0;
}
.nav-item.active .nav-pill { opacity: 1; transform: scale(1); }
.nav-item.center svg { width: 24px; height: 24px; }

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + var(--player-height) + var(--safe-b) + 14px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 10px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  z-index: 100; opacity: 0; transition: all .3s var(--ease); pointer-events: none;
  white-space: nowrap; background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   Misc / animations
   ========================================================= */
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.skeleton { background: linear-gradient(90deg, var(--glass-bg) 25%, var(--glass-bg-strong) 50%, var(--glass-bg) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); height: 60px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 30px 12px; color: var(--text-dim); font-size: 13px; }

::selection { background: var(--accent); color: #07111f; }
