:root {
  --bg: #061014;
  --bg2: #0b1d25;
  --panel: rgba(255, 255, 255, 0.075);
  --panel2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.11);
  --gold: #d9ae57;
  --gold2: #f0ca78;
  --green: #4bb990;
  --text: #fff8ed;
  --muted: #bdb4a6;
  --dark: #05090c;
  --radius: 28px;
  --shadow: 0 24px 80px rgba(0,0,0,0.44);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Cairo", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(75,185,144,0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(217,174,87,0.18), transparent 28%),
    linear-gradient(145deg, var(--bg), var(--bg2) 60%, #020405);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle, black, transparent 80%);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  direction: ltr;
  unicode-bidi: embed;
  color: var(--gold2);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 54px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 16px;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(6,16,20,0.98), rgba(6,16,20,0.72), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #15100a;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold2), #9d7430);
  box-shadow: 0 14px 32px rgba(217,174,87,0.25);
}

.brand strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.15;
}

.brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.search {
  position: relative;
  flex: 1;
}

.search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 44px 0 16px;
  color: var(--text);
  background: rgba(255,255,255,0.07);
  outline: none;
}

.search input::placeholder {
  color: rgba(255,248,237,0.55);
}

.search::before {
  content: "⌕";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 1.45rem;
}

.small-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.small-nav button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  background: rgba(255,255,255,0.065);
  transition: 0.18s ease;
}

.small-nav button:hover {
  background: rgba(217,174,87,0.15);
  border-color: rgba(217,174,87,0.28);
}

.hero {
  min-height: calc(100vh - 110px);
  display: grid;
  align-items: center;
  padding: 28px 0 42px;
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: clamp(22px, 4vw, 46px);
  background:
    radial-gradient(circle at 16% 12%, rgba(217,174,87,0.16), transparent 28%),
    linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.center {
  text-align: center;
  max-width: 850px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold2);
  background: rgba(217,174,87,0.11);
  border: 1px solid rgba(217,174,87,0.22);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 800;
  font-size: 0.88rem;
}

h1 {
  margin: 18px 0 12px;
  font-size: clamp(2.35rem, 8vw, 6.2rem);
  line-height: 1.04;
  letter-spacing: -2px;
  font-weight: 900;
}

h1 span {
  color: var(--gold2);
}

.lead {
  margin: 0 auto;
  color: var(--muted);
  line-height: 2;
  font-size: clamp(1rem, 2vw, 1.18rem);
  max-width: 760px;
}

.doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 34px;
}

.door {
  position: relative;
  overflow: hidden;
  min-height: 235px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255,255,255,0.085), rgba(255,255,255,0.035));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  transition: 0.22s ease;
}

.door::after {
  content: "";
  position: absolute;
  left: -55px;
  bottom: -65px;
  width: 170px;
  height: 170px;
  border-radius: 52px;
  transform: rotate(25deg);
  background: rgba(255,255,255,0.055);
}

.door:hover {
  transform: translateY(-5px);
  border-color: rgba(217,174,87,0.32);
  background: linear-gradient(145deg, rgba(217,174,87,0.13), rgba(255,255,255,0.04));
}

.door-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  font-size: 1.9rem;
  margin-bottom: 18px;
}

.door h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.door p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.95rem;
}

.door strong {
  margin-top: auto;
  color: var(--gold2);
  padding-top: 18px;
}

.section {
  display: none;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: clamp(18px, 3vw, 30px);
  background: rgba(255,255,255,0.055);
  box-shadow: 0 20px 70px rgba(0,0,0,0.28);
}

.section.active {
  display: block;
  animation: fadeIn 0.25s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.back-home {
  border: 1px solid rgba(217,174,87,0.24);
  border-radius: 999px;
  color: var(--text);
  background: rgba(217,174,87,0.11);
  padding: 9px 15px;
  min-width: max-content;
}

.quran-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.player-panel,
.ayah-panel,
.simple-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(0,0,0,0.19);
  overflow: hidden;
}

.player-panel {
  padding: 14px;
}

.video-box {
  min-height: 390px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    radial-gradient(circle at center, rgba(217,174,87,0.14), transparent 36%),
    linear-gradient(145deg, #071217, #0d242d);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.video-box video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-empty {
  padding: 28px;
  text-align: center;
}

.play-circle {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: var(--gold2);
  font-size: 2.2rem;
  border: 1px solid rgba(217,174,87,0.26);
  background: rgba(217,174,87,0.1);
}

.video-empty h3 {
  margin: 0 0 8px;
  font-size: 1.32rem;
}

.video-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.controls select,
.controls button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255,255,255,0.075);
  padding: 8px 12px;
  outline: none;
}



/* =========================================================
   FIX: Native dropdown colors
   Prevents white text on white dropdown background.
   Keep this block directly after the .controls select/button block.
   ========================================================= */

.controls select {
  color: var(--text);
  background-color: #18282d;
}

.controls select option {
  color: var(--text);
  background-color: #18282d;
}

.controls select option:checked {
  color: #14100a;
  background-color: var(--gold2);
}

/* Extra browser fallback */
select,
select option {
  background-color: #18282d;
  color: #fff8ed;
}

.controls .watch {
  background: linear-gradient(135deg, var(--gold2), #9d7430);
  color: #14100a;
  border: 0;
  font-weight: 900;
}

.ayah-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(75,185,144,0.12);
  border: 1px solid rgba(75,185,144,0.18);
}

.badge strong {
  color: var(--green);
}

.ayah-text {
  font-family: "Amiri", serif;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 2.1;
  text-align: center;
  padding: 18px 0;
}

.meaning {
  color: var(--muted);
  line-height: 1.9;
  text-align: center;
}

.ayah-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: auto;
}

.ayah-buttons button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.065);
  font-weight: 800;
}

.ayah-buttons button.active,
.ayah-buttons button:hover {
  background: var(--gold2);
  color: #14100a;
  border-color: transparent;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  min-height: 178px;
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.028));
  transition: 0.18s ease;
  color: var(--text);
  text-align: right;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(217,174,87,0.26);
}

.card .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.14rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.94rem;
}

.episodes {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.episode {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  padding: 14px;
}

.episode h4 {
  margin: 0 0 4px;
}

.episode p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.episode button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 15px;
  color: #14100a;
  background: var(--gold2);
  font-weight: 900;
}

.simple-panel {
  padding: 20px;
}

.dua-list {
  display: grid;
  gap: 12px;
}

.dua-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,0.045);
}

.dua-item h3 {
  margin: 0 0 8px;
  color: var(--gold2);
}

.dua-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.error-box {
  border: 1px solid rgba(215, 95, 95, 0.35);
  background: rgba(215, 95, 95, 0.13);
  color: #ffd9d9;
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.8;
  margin: 12px 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .topbar {
    flex-wrap: wrap;
  }

  .brand {
    width: 100%;
  }

  .small-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .doors,
  .quran-layout,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .video-box {
    min-height: 280px;
  }
}

@media (max-width: 540px) {
  .wrap {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .hero-card,
  .section {
    border-radius: 24px;
  }

  .door {
    min-height: 190px;
  }

  .section-head {
    flex-direction: column;
  }

  .back-home {
    width: 100%;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}
