:root {
  --ink: #14201c;
  --ink-soft: rgba(20, 32, 28, 0.72);
  --paper: rgba(247, 241, 230, 0.88);
  --paper-strong: rgba(252, 248, 240, 0.94);
  --line: rgba(20, 32, 28, 0.12);
  --gold: #c4a35a;
  --gold-deep: #9a7a35;
  --teal: #1f5c4d;
  --teal-deep: #0d2f28;
  --mist: rgba(255, 255, 255, 0.55);
  --danger: #8b3a2f;
  --shadow: 0 24px 60px rgba(8, 20, 16, 0.35);
  --radius: 22px;
  --font-display: "Amiri", "Times New Roman", serif;
  --font-ui: "Outfit", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: #0b1c18;
  min-height: 100vh;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--sky);
  transition: background 0.8s ease;
}

.atmosphere__glow {
  position: absolute;
  inset: -10% 0 auto;
  height: 55%;
  background: var(--glow);
  animation: breathe 10s ease-in-out infinite;
  transition: background 0.8s ease;
}

/* Reciter / Adhan atmosphere themes */
body,
body[data-theme="alafasy"] {
  --sky:
    radial-gradient(ellipse 80% 55% at 50% 18%, rgba(255, 186, 92, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(31, 92, 77, 0.45), transparent 60%),
    linear-gradient(180deg, #1a3a32 0%, #0b1c18 48%, #071410 100%);
  --glow: radial-gradient(circle at 50% 40%, rgba(255, 210, 140, 0.5), transparent 62%);
}

body[data-theme="nafees"] {
  --sky:
    radial-gradient(ellipse 75% 50% at 45% 15%, rgba(255, 168, 76, 0.42), transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 75%, rgba(120, 72, 36, 0.4), transparent 60%),
    linear-gradient(180deg, #3a2618 0%, #1a120c 50%, #0c0806 100%);
  --glow: radial-gradient(circle at 48% 38%, rgba(255, 190, 110, 0.55), transparent 62%);
}

body[data-theme="turkey"] {
  --sky:
    radial-gradient(ellipse 80% 55% at 50% 12%, rgba(140, 200, 220, 0.35), transparent 55%),
    radial-gradient(ellipse 55% 50% at 20% 80%, rgba(28, 70, 90, 0.45), transparent 60%),
    linear-gradient(180deg, #163842 0%, #0c1e28 48%, #071018 100%);
  --glow: radial-gradient(circle at 50% 36%, rgba(180, 220, 235, 0.42), transparent 62%);
}

body[data-theme="jenkins"] {
  --sky:
    radial-gradient(ellipse 80% 55% at 55% 18%, rgba(210, 200, 170, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 70%, rgba(60, 70, 80, 0.4), transparent 60%),
    linear-gradient(180deg, #2a3038 0%, #14181e 50%, #0a0c10 100%);
  --glow: radial-gradient(circle at 52% 40%, rgba(230, 220, 190, 0.35), transparent 62%);
}

body[data-theme="dubai"] {
  --sky:
    radial-gradient(ellipse 75% 50% at 50% 10%, rgba(255, 200, 90, 0.4), transparent 52%),
    radial-gradient(ellipse 50% 45% at 75% 70%, rgba(20, 50, 80, 0.5), transparent 60%),
    linear-gradient(180deg, #1c2a3a 0%, #0e1824 48%, #060b12 100%);
  --glow: radial-gradient(circle at 50% 32%, rgba(255, 215, 120, 0.48), transparent 60%);
}

body[data-theme="alafasy2"] {
  --sky:
    radial-gradient(ellipse 80% 55% at 50% 18%, rgba(120, 210, 170, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(18, 90, 70, 0.5), transparent 60%),
    linear-gradient(180deg, #0f3a30 0%, #08221c 48%, #041410 100%);
  --glow: radial-gradient(circle at 50% 40%, rgba(150, 230, 190, 0.4), transparent 62%);
}

body[data-theme="zahrani"] {
  --sky:
    radial-gradient(ellipse 80% 55% at 40% 16%, rgba(255, 170, 90, 0.38), transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 65%, rgba(90, 50, 30, 0.45), transparent 60%),
    linear-gradient(180deg, #4a2e1a 0%, #24160e 50%, #100a07 100%);
  --glow: radial-gradient(circle at 42% 36%, rgba(255, 185, 110, 0.5), transparent 62%);
}

body[data-theme="jordan"] {
  --sky:
    radial-gradient(ellipse 80% 55% at 50% 14%, rgba(255, 140, 90, 0.4), transparent 55%),
    radial-gradient(ellipse 55% 50% at 25% 75%, rgba(90, 35, 40, 0.45), transparent 60%),
    linear-gradient(180deg, #3a1c22 0%, #1a0e14 48%, #0a070a 100%);
  --glow: radial-gradient(circle at 50% 34%, rgba(255, 150, 100, 0.48), transparent 62%);
}

.atmosphere__mosque {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background:
    linear-gradient(180deg, transparent, rgba(4, 14, 12, 0.85)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%23060f0c' d='M0 224h80c40 0 60-32 100-32s70 32 110 32 70-48 110-48 70 48 110 48 70-40 110-40 70 40 110 40 70-56 110-56 70 56 110 56 70-32 110-32 70 32 110 32 70-24 110-24 70 24 110 24h80v96H0z'/%3E%3Cpath fill='%230a1814' d='M0 256c48-24 96-72 160-72s112 64 176 64 112-80 176-80 112 72 176 72 112-56 176-56 112 80 176 80 112-48 176-48 128 72 160 72v32H0z'/%3E%3C/svg%3E")
      bottom / 100% 100% no-repeat;
  opacity: 0.95;
}

.atmosphere__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 20, 16, 0.15), rgba(7, 20, 16, 0.55) 70%, rgba(7, 20, 16, 0.82)),
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 40px,
      rgba(255, 255, 255, 0.015) 40px,
      rgba(255, 255, 255, 0.015) 41px
    );
}

.topbar,
.shell,
.statusbar {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem 0;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: #f7f1e6;
}

.brand__mark {
  color: var(--gold);
  font-size: 1.1rem;
  animation: twinkle 3.5s ease-in-out infinite;
}

.brand__name {
  font-family: var(--font-ui);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
}

.topbar__status {
  margin: 0;
  color: rgba(247, 241, 230, 0.72);
  font-size: 0.92rem;
  font-weight: 400;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 5.5rem;
}

.hero {
  text-align: center;
  color: #f7f1e6;
  padding: 1.5rem 0 1.75rem;
  animation: rise 0.9s ease both;
}

.hero__dates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.1rem;
  margin: 0 auto 0.85rem;
  max-width: 46rem;
}

.hero__date {
  margin: 0;
  min-width: 9.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  background: rgba(7, 20, 16, 0.28);
  border: 1px solid rgba(247, 241, 230, 0.12);
  text-align: center;
}

.hero__date-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 241, 230, 0.62);
  margin-bottom: 0.15rem;
}

.hero__date strong {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  color: #f7f1e6;
}

.hero__brand {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(3.2rem, 8.5vw, 5.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.06em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.hero__lede {
  max-width: 34rem;
  margin: 0.85rem auto 1.35rem;
  font-size: 1.08rem;
  font-weight: 300;
  color: rgba(247, 241, 230, 0.86);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.audio-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  max-width: min(100%, 26rem);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(247, 241, 230, 0.12);
  border: 1px solid rgba(247, 241, 230, 0.28);
  color: #f7f1e6;
  cursor: pointer;
  user-select: none;
  text-align: left;
}

.audio-switch.is-on {
  background: rgba(212, 181, 106, 0.92);
  border-color: transparent;
  color: #1a1408;
}

.audio-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.audio-switch__track {
  position: relative;
  flex: 0 0 3.1rem;
  width: 3.1rem;
  height: 1.7rem;
  border-radius: 999px;
  background: rgba(247, 241, 230, 0.28);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: background 0.2s ease;
}

.audio-switch__track::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #f7f1e6;
  transition: transform 0.2s ease;
}

.audio-switch.is-on .audio-switch__track {
  background: rgba(26, 20, 8, 0.35);
}

.audio-switch.is-on .audio-switch__track::after {
  transform: translateX(1.35rem);
  background: #fff8ea;
}

.audio-switch__copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.audio-switch__copy strong {
  font-size: 1rem;
  font-weight: 700;
}

.audio-switch__copy small {
  font-size: 0.78rem;
  line-height: 1.25;
  opacity: 0.88;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 1.1rem;
  align-items: start;
  animation: rise 1.1s ease 0.12s both;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 1.25rem 1.3rem 1.4rem;
}

.panel--settings {
  background: var(--paper-strong);
}

.panel__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.15;
}

.panel__sub {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.next-pill {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(31, 92, 77, 0.14), rgba(196, 163, 90, 0.18));
  border: 1px solid rgba(31, 92, 77, 0.18);
  min-width: 7.5rem;
}

.next-pill__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.countdown {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(13, 47, 40, 0.08);
}

.secondary-alerts {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.secondary-alerts__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.secondary-alerts__lede {
  margin: 0.35rem 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.secondary-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) auto minmax(0, 1.2fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(20, 32, 28, 0.08);
}

.secondary-row:last-child {
  border-bottom: 0;
}

.secondary-row__name {
  font-weight: 500;
}

.secondary-row .select {
  padding: 0.45rem 0.6rem;
}

.sound-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.transport {
  display: inline-flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.transport__btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 999px;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}

.transport__btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.transport__btn.is-active {
  background: var(--gold);
  border-color: transparent;
  color: #1a1712;
}

@media (max-width: 560px) {
  .secondary-row {
    grid-template-columns: 1fr;
  }

  .sound-row {
    grid-template-columns: 1fr;
  }
}

.countdown__label {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.countdown__value {
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
}

.prayers {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
}

.prayer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.35);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.prayer.is-next {
  background: linear-gradient(135deg, rgba(31, 92, 77, 0.16), rgba(196, 163, 90, 0.2));
  border-color: rgba(31, 92, 77, 0.25);
  transform: translateY(-1px);
}

.prayer.is-passed {
  opacity: 0.55;
}

.prayer__name {
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.prayer__tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prayer__time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--teal-deep);
}

.adhan-picker {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.field-label {
  display: block;
  margin: 0.85rem 0 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.adhan-picker > .field-label:first-child {
  margin-top: 0;
}

.select,
.input {
  width: 100%;
  border: 1px solid rgba(20, 32, 28, 0.16);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select:focus,
.input:focus {
  border-color: rgba(31, 92, 77, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 92, 77, 0.12);
}

.checks {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.94rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.check input {
  margin-top: 0.2rem;
  accent-color: var(--teal);
}

.fajr-row {
  margin-top: 0.35rem;
}

.player {
  margin-top: 1rem;
}

.player audio {
  width: 100%;
  border-radius: 12px;
}

.player__toolbar {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.player__hint {
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.suggestions {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 12px 28px rgba(8, 20, 16, 0.12);
}

.suggestions__hint {
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.suggestions button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
}

.suggestions button:hover,
.suggestions button:focus-visible {
  background: rgba(31, 92, 77, 0.1);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.footnote {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: #f7f1e6;
  color: var(--teal-deep);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.btn--primary.is-on {
  background: var(--gold);
  color: #1a1408;
}

.btn--ghost {
  background: transparent;
  color: #f7f1e6;
  border-color: rgba(247, 241, 230, 0.35);
}

.panel .btn--ghost {
  color: var(--teal-deep);
  border-color: rgba(20, 32, 28, 0.18);
}

.btn--gold {
  background: linear-gradient(180deg, #d4b56a, var(--gold-deep));
  color: #1a1408;
  box-shadow: 0 8px 22px rgba(154, 122, 53, 0.28);
}

.statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(8, 20, 16, 0.88);
  color: rgba(247, 241, 230, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(247, 241, 230, 0.08);
  font-size: 0.92rem;
}

.statusbar__audio {
  font-weight: 700;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
}

.statusbar__audio.is-on {
  background: rgba(212, 181, 106, 0.95);
  color: #1a1408;
}

.statusbar__audio.is-off {
  background: rgba(247, 241, 230, 0.12);
  color: rgba(247, 241, 230, 0.88);
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

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

@media (max-width: 900px) {
  .stage {
    grid-template-columns: 1fr;
  }

  .panel__head {
    flex-direction: column;
  }

  .next-pill {
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .topbar,
  .shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

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

  .hero__actions,
  .search,
  .settings-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .statusbar {
    flex-direction: column;
    gap: 0.25rem;
  }
}
