/* Nuit shared design system */
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300&family=Cinzel:wght@400;500&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* CSS Variables */
:root {
  --bg: #050a18;
  --bg-light: #0d1f3c;
  --gold: #d4af37;
  --gold-dim: rgba(212,175,55,.55);
  --cream: #f5e6c8;
  --cream-dim: rgba(245,230,200,.45);
  --cream-faint: rgba(245,230,200,.28);
  --card-bg: rgba(255,255,255,.03);
  --card-border: rgba(212,175,55,.15);
  --card-border-active: rgba(212,175,55,.5);
  --danger: rgba(220,80,80,.8);
  --success: #4caf50;
  --nav-height: 60px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

/* Body */
html, body { min-height: 100%; background: var(--bg); }
body {
  font-family: 'Cormorant Garamond', serif;
  color: var(--cream);
  background: radial-gradient(ellipse at 50% 0%, var(--bg-light) 0%, var(--bg) 65%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(44px + env(safe-area-inset-top, 0px)) 18px calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
  position: relative;
  overflow-x: hidden;
}

/* Stars */
#stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: twinkle var(--dur) var(--delay) infinite ease-in-out;
}
@keyframes twinkle {
  0%,100% { opacity: 0; transform: scale(1); }
  50%      { opacity: .8; transform: scale(1.4); }
}

/* Moon */
.moon { font-size: 50px; margin-bottom: 22px; filter: drop-shadow(0 0 22px rgba(212,175,55,.5)); display: inline-block; animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }

/* Layout */
#app { position: relative; z-index: 1; width: 100%; max-width: 490px; display: flex; flex-direction: column; align-items: center; }
.screen { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Typography */
.label-caps { font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 4px; color: var(--gold-dim); text-transform: uppercase; }
h1 { font-weight: 300; font-size: 28px; letter-spacing: 2px; line-height: 1.3; text-align: center; }
h2 { font-weight: 300; font-size: 22px; letter-spacing: 1.5px; line-height: 1.3; text-align: center; color: var(--cream); }
h3 { font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 2px; color: var(--gold); text-transform: uppercase; }
.ayah { font-size: 13px; font-style: italic; color: var(--cream-dim); letter-spacing: 1px; margin-top: 10px; text-align: center; }
.ayah-ref { font-size: 11px; color: var(--cream-faint); letter-spacing: .8px; margin-top: 4px; text-align: center; line-height: 1.7; }

/* Arabic text */
.arabic { font-family: 'Amiri', serif; direction: rtl; text-align: right; font-size: 22px; line-height: 2; color: var(--cream); }
.arabic-lg { font-family: 'Amiri', serif; direction: rtl; text-align: center; font-size: 28px; line-height: 1.8; color: var(--cream); }
.phonetic { font-style: italic; color: var(--gold); font-size: 14px; letter-spacing: .5px; }
.translation { color: rgba(245,230,200,.5); font-size: 13px; line-height: 1.7; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 8px; padding: 18px 22px; width: 100%; }
.card-glow { border-color: var(--card-border-active) !important; background: rgba(212,175,55,.06) !important; animation: pulseGlow 2.5s ease-in-out infinite; }
@keyframes pulseGlow { 0%,100%{box-shadow:0 0 20px rgba(212,175,55,.25)} 50%{box-shadow:0 0 55px rgba(212,175,55,.55),0 0 110px rgba(212,175,55,.15)} }
.card-link { text-decoration: none; color: inherit; display: block; transition: border-color .3s, background .3s; }
.card-link:hover, .card-link:active { border-color: var(--card-border-active); background: rgba(212,175,55,.06); }

/* Buttons */
.btn { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; border: 1px solid rgba(212,175,55,.5); color: var(--gold); background: rgba(212,175,55,.07); padding: 12px 24px; border-radius: 4px; cursor: pointer; transition: all .25s; width: 100%; display: block; margin-bottom: 10px; }
.btn:hover, .btn:active { background: rgba(212,175,55,.18); border-color: var(--gold); }
.btn-ghost { border-color: rgba(255,255,255,.12); color: rgba(245,230,200,.4); background: transparent; font-size: 10px; padding: 9px 18px; margin-bottom: 0; }
.btn-ghost:hover, .btn-ghost:active { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.28); color: rgba(245,230,200,.7); }
.btn-sm { width: auto; display: inline-block; padding: 8px 16px; font-size: 10px; margin-bottom: 0; }
.btn-gold { background: rgba(212,175,55,.15); border-color: var(--gold); color: var(--gold); }

/* Inputs */
.time-input { background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.3); color: var(--cream); font-family: 'Cinzel', serif; font-size: 20px; letter-spacing: 4px; text-align: center; width: 118px; padding: 10px 6px; border-radius: 4px; outline: none; transition: all .3s; }
.time-input:focus { border-color: var(--gold); background: rgba(212,175,55,.08); }
.time-input::-webkit-calendar-picker-indicator { filter: invert(1) sepia(1) saturate(3); opacity: .45; cursor: pointer; }
.ctrl-input { background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.2); color: rgba(245,230,200,.65); font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 1.2px; padding: 9px 10px; border-radius: 4px; outline: none; width: 100%; cursor: pointer; }
.ctrl-input option { background: #0d1a30; }
.ctrl-input::-webkit-calendar-picker-indicator { filter: invert(1) sepia(1) saturate(2); opacity: .35; cursor: pointer; }
.text-input { background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.2); color: var(--cream); font-family: 'Cormorant Garamond', serif; font-size: 14px; padding: 10px 14px; border-radius: 4px; outline: none; width: 100%; transition: border-color .3s; }
.text-input:focus { border-color: var(--gold); }
.text-input::placeholder { color: rgba(245,230,200,.3); }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 1.8px; }
.badge-gold { background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.4); color: var(--gold); }
.badge-dim  { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);  color: rgba(245,230,200,.4); }

/* Shimmer */
.shimmer-text { background: linear-gradient(90deg,#d4af37,#f5e6c8,#d4af37,#b8960c); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: shimmer 3s linear infinite; }
@keyframes shimmer { 0%{background-position:-200% center} 100%{background-position:200% center} }

/* Progress */
.progress-track { height: 3px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: visible; position: relative; }
.progress-fill  { height: 100%; border-radius: 2px; background: linear-gradient(90deg,#1a3a6b,#4a7ab5,#d4af37); transition: width 1s ease; position: relative; }
.progress-fill::after { content: ''; position: absolute; right: -4px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* Spinner */
.spinner { width: 28px; height: 28px; border: 2px solid rgba(212,175,55,.2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Prayer grid */
.prayer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 6px; }
.prayer-cell { text-align: center; }
.prayer-name { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 1.5px; color: rgba(245,230,200,.3); }
.prayer-time { font-size: 18px; letter-spacing: 2px; margin-top: 3px; color: rgba(245,230,200,.65); }
.prayer-time.highlight { color: rgba(212,175,55,.85); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.stat-card { text-align: center; }
.stat-label { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 2px; color: rgba(245,230,200,.28); text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 26px; letter-spacing: 2px; color: var(--gold); }

/* Tiers grid */
.tiers-grid { display: flex; justify-content: space-between; margin-top: 16px; }
.tier-col { text-align: center; flex: 1; }
.tier-label { font-family: 'Cinzel', serif; font-size: 12px; transition: color .4s; }
.tier-time  { font-size: 11px; color: rgba(245,230,200,.28); margin-top: 3px; }

/* Accordion */
.accordion { width: 100%; }
.accordion-item { border-bottom: 1px solid rgba(212,175,55,.08); }
.accordion-header {
  width: 100%; background: none; border: none; color: var(--cream); font-family: 'Cormorant Garamond', serif;
  font-size: 16px; letter-spacing: 1px; padding: 14px 0; cursor: pointer; text-align: left;
  display: flex; justify-content: space-between; align-items: center; transition: color .3s;
}
.accordion-header:hover { color: var(--gold); }
.accordion-header::after { content: '⌄'; font-size: 12px; color: var(--gold-dim); transition: transform .3s; }
.accordion-header.open::after { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.accordion-body.open { max-height: 5000px; }
.accordion-content { padding: 0 0 16px; }

/* Tabs */
.tab-bar { display: flex; gap: 0; width: 100%; border-bottom: 1px solid rgba(212,175,55,.15); margin-bottom: 16px; }
.tab-btn {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  color: rgba(245,230,200,.4); font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 1.5px;
  padding: 10px 4px; cursor: pointer; transition: all .3s; text-transform: uppercase;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover { color: rgba(245,230,200,.7); }
.tab-panel { display: none; width: 100%; }
.tab-panel.active { display: block; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5,10,24,.85); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: #0a1628; border: 1px solid var(--card-border); border-radius: 12px;
  padding: 28px 24px; max-width: 420px; width: 100%; max-height: 85vh; overflow-y: auto;
}
.modal-close {
  background: none; border: none; color: var(--gold-dim); font-size: 20px; cursor: pointer;
  float: right; margin-top: -8px;
}
/* PWA Install */
.install-banner {
  position: fixed; left: 14px; right: 14px; bottom: calc(var(--nav-height) + 14px); z-index: 70;
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center;
  padding: 12px; border-radius: 18px; border: 1px solid rgba(212,175,55,.28);
  background: linear-gradient(145deg, rgba(9,22,39,.97), rgba(13,31,55,.94));
  box-shadow: 0 20px 54px rgba(0,0,0,.46), inset 0 0 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(14px); animation: fadeUp .35s ease forwards;
}
.install-banner img { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 0 22px rgba(212,175,55,.18); }
.install-title { font-family: 'Cinzel', serif; color: var(--cream); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; }
.install-text { color: rgba(245,230,200,.48); font-size: 11px; line-height: 1.35; margin-top: 3px; }
.install-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.install-never {
  min-height: 44px; border: 0; background: transparent; color: rgba(245,230,200,.38);
  cursor: pointer; font-size: 11px; padding: 8px 4px;
}
@media (min-width: 768px) {
  .install-banner { left: calc(var(--nav-height) + 24px); right: 24px; bottom: 24px; max-width: 430px; }
}
@media (max-width: 420px) {
  .install-banner { grid-template-columns: 42px 1fr; }
  .install-banner img { width: 42px; height: 42px; }
  .install-actions { justify-content: stretch; }
  .install-actions .btn { flex: 1; }
  .install-never { width: 100%; }
}

/* Counter / Dhikr */
.counter-btn {
  width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(212,175,55,.3);
  background: rgba(212,175,55,.05); color: var(--gold); font-family: 'Cinzel', serif;
  font-size: 20px; cursor: pointer; transition: all .2s; display: inline-flex;
  align-items: center; justify-content: center;
}
.counter-btn:hover { background: rgba(212,175,55,.15); border-color: var(--gold); }
.counter-btn.done { background: rgba(76,175,80,.15); border-color: var(--success); color: var(--success); }

/* Utils */
.gap-col { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.gap-row { display: flex; gap: 8px; width: 100%; }
.gap-row-center { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; width: 100%; }
.mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mt28 { margin-top: 28px; }
.mb8  { margin-bottom: 8px; }
.mb10 { margin-bottom: 10px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.mb20 { margin-bottom: 20px; }
.mb28 { margin-bottom: 28px; }
.center { text-align: center; }
.hidden { display: none !important; }
.fadein { animation: fadeUp .5s ease forwards; }
@keyframes fadeUp { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
.flex-center { display: flex; align-items: center; justify-content: center; }
.w100 { width: 100%; }
.text-gold { color: var(--gold); }
.text-dim { color: rgba(245,230,200,.4); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 10px; }

.footer-note { margin-top: 22px; text-align: center; font-size: 12px; font-style: italic; color: rgba(245,230,200,.22); line-height: 1.9; }

/* Bottom Navigation */
.nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: #0a1628; border-top: 1px solid rgba(212,175,55,.12);
  display: flex; justify-content: space-around; align-items: center;
  height: var(--nav-height); padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: rgba(245,230,200,.35); font-size: 9px;
  font-family: 'Cinzel', serif; letter-spacing: .25px; gap: 3px;
  padding: 6px 2px; flex: 1; min-width: 0; text-align: center; transition: color .3s;
  border-top: 2px solid transparent;
}
.nav-item .nav-icon { width: 22px; height: 22px; display: block; }
.nav-item span:last-child { max-width: 100%; white-space: normal; line-height: 1.05; overflow-wrap: anywhere; }
.nav-item.active { color: var(--gold); border-top-color: var(--gold); }
.nav-item:hover { color: rgba(245,230,200,.6); }

/* Desktop: sidebar */
@media (min-width: 768px) {
  body { padding-left: calc(var(--nav-height) + 18px); padding-bottom: 44px; }
  .nav-bar {
    top: 0; bottom: 0; left: 0; right: auto; width: var(--nav-height);
    flex-direction: column; justify-content: center; gap: 4px;
    border-top: none; border-right: 1px solid rgba(212,175,55,.12);
    height: 100vh;
  }
  .nav-item { border-top: none; border-left: 2px solid transparent; padding: 8px 4px; }
  .nav-item.active { border-top: none; border-left-color: var(--gold); }
  .nav-item span:last-child { display: none; }
  .nav-item .nav-icon { width: 22px; height: 22px; }
}

/* Touch Target & Accessibility Fixes */
.btn-sm { min-height: 44px; min-width: 44px; }
.tab-btn { min-height: 44px; }
.zikr-btn { min-width: 44px; min-height: 44px; }
button[onclick] { min-height: 44px; }
.check-btn { min-width: 44px; min-height: 44px; }
.player-nav button { min-width: 44px; min-height: 44px; }
.size-ctrl button { min-width: 44px; min-height: 44px; }
.cal-nav button { min-height: 44px; }
.bookmark-btn { min-height: 44px; }
.fasting-btn { min-height: 44px; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,.2); border-radius: 2px; }

/* Selection */
::selection { background: rgba(212,175,55,.3); color: var(--cream); }

/* Nuit premium visual layer */
:root {
  --nuit-bg: #03142f;
  --nuit-bg-deep: #020b1e;
  --nuit-bg-soft: #071c3a;
  --nuit-card: rgba(5, 22, 51, .9);
  --nuit-card-strong: rgba(8, 28, 61, .96);
  --nuit-border: rgba(211, 162, 76, .38);
  --nuit-border-soft: rgba(211, 162, 76, .16);
  --nuit-gold: #d7a955;
  --nuit-gold-bright: #f1cc76;
  --nuit-gold-dim: rgba(215, 169, 85, .6);
  --nuit-text: #f4efe6;
  --nuit-text-soft: rgba(244, 239, 230, .74);
  --nuit-text-muted: rgba(244, 239, 230, .44);
  --nuit-green: #38c6a5;
  --bg: var(--nuit-bg-deep);
  --bg-light: var(--nuit-bg-soft);
  --gold: var(--nuit-gold);
  --gold-dim: var(--nuit-gold-dim);
  --cream: var(--nuit-text);
  --cream-dim: var(--nuit-text-muted);
  --card-bg: var(--nuit-card);
  --card-border: var(--nuit-border-soft);
  --card-border-active: var(--nuit-border);
  --success: var(--nuit-green);
  --nav-height: 86px;
}

html,
body {
  background:
    radial-gradient(circle at 50% 7%, rgba(23, 61, 111, .52), transparent 34%),
    radial-gradient(circle at 88% 4%, rgba(215, 169, 85, .08), transparent 24%),
    linear-gradient(180deg, #03152f 0%, #020c20 58%, #010817 100%);
}

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 18px calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 24px);
  color: var(--nuit-text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 24% 16%, rgba(255,255,255,.08) 0 1px, transparent 1.4px),
    radial-gradient(circle at 72% 22%, rgba(255,255,255,.55) 0 1px, transparent 1.4px),
    radial-gradient(circle at 86% 56%, rgba(215,169,85,.45) 0 1px, transparent 1.3px),
    radial-gradient(circle at 14% 68%, rgba(255,255,255,.42) 0 1px, transparent 1.3px);
  background-size: 280px 360px, 360px 420px, 420px 460px, 320px 390px;
  opacity: .46;
  z-index: 0;
}

#app {
  max-width: 430px;
  gap: 14px;
}

.app-shell,
.page-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.screen {
  gap: 14px;
}

.label-caps {
  color: var(--nuit-gold);
  letter-spacing: 2.8px;
  font-weight: 600;
}

h1,
h2 {
  color: var(--nuit-text);
  text-shadow: 0 2px 18px rgba(0,0,0,.24);
}

h1 {
  font-size: clamp(31px, 9vw, 40px);
  letter-spacing: .2px;
}

h2 {
  font-size: clamp(24px, 7vw, 31px);
}

h3 {
  color: var(--nuit-gold);
}

.nuit-svg-icon {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 9px rgba(215,169,85,.18));
}

.nuit-image-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 9px rgba(215,169,85,.18));
}

.nuit-svg-icon .halo {
  opacity: .28;
}

.moon.nuit-page-mark {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  padding: 10px;
  border: 1px solid rgba(215,169,85,.34);
  border-radius: 24px;
  background:
    radial-gradient(circle at 34% 18%, rgba(255,244,196,.14), transparent 30%),
    linear-gradient(145deg, rgba(8,31,65,.96), rgba(2,12,30,.98));
  box-shadow: 0 18px 48px rgba(0,0,0,.36), inset 0 0 0 1px rgba(255,255,255,.035);
  animation: none;
  filter: none;
}

.card,
.active-plan-card,
.progress-card,
.option-card,
.juz-row,
.zikr-card,
.resource-card,
.path-card,
.topic-grid a,
.fact-card,
.quick-map a,
.howto-card,
.case {
  border: 1px solid var(--nuit-border-soft) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,.075), transparent 32%),
    linear-gradient(145deg, rgba(9, 30, 64, .91), rgba(3, 15, 37, .95)) !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.34), inset 0 0 0 1px rgba(255,255,255,.025);
}

.card {
  padding: 18px;
}

.card-link,
.resource-card,
.path-card,
.topic-grid a,
.quick-map a,
.case,
.option-card,
.juz-row {
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.card-link:hover,
.resource-card:hover,
.path-card:hover,
.topic-grid a:hover,
.quick-map a:hover,
.option-card:hover,
.juz-row:hover {
  transform: translateY(-1px);
  border-color: rgba(215,169,85,.42) !important;
}

.btn,
.primary-cta {
  min-height: 48px;
  border-radius: 999px;
  border-color: rgba(215,169,85,.54);
  background: linear-gradient(145deg, rgba(215,169,85,.16), rgba(215,169,85,.055));
  color: var(--nuit-gold-bright);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 10px 30px rgba(0,0,0,.18);
}

.btn-ghost,
.secondary-cta,
.bookmark-btn,
.player-actions button,
.player-nav button,
.size-ctrl button,
.cal-nav button {
  border-radius: 14px !important;
  border-color: rgba(215,169,85,.22) !important;
  background: rgba(255,255,255,.035) !important;
  color: rgba(244,239,230,.72) !important;
}

.btn:hover,
.btn:active,
.bookmark-btn:hover,
.player-actions button:hover,
.player-nav button:hover,
.size-ctrl button:hover,
.cal-nav button:hover {
  border-color: rgba(241,204,118,.72) !important;
  background: rgba(215,169,85,.12) !important;
  color: var(--nuit-gold-bright) !important;
}

.text-input,
.ctrl-input,
.field input,
.field select,
.reciter-field,
.search-box input {
  border-radius: 14px !important;
  border-color: rgba(215,169,85,.2) !important;
  background: rgba(3,14,34,.74) !important;
  color: var(--nuit-text) !important;
}

.badge {
  min-height: 36px;
  border-radius: 999px;
}

.badge-dim {
  border-color: rgba(215,169,85,.16);
  background: rgba(255,255,255,.035);
  color: rgba(244,239,230,.62);
}

.badge-gold {
  border-color: rgba(215,169,85,.42);
  background: rgba(215,169,85,.1);
  color: var(--nuit-gold-bright);
}

.arabic,
.arabic-lg,
.ayah-text,
.zikr-arabic {
  text-shadow: 0 2px 18px rgba(0,0,0,.24);
}

.progress-track,
.nuit-progress-track {
  background: rgba(244,239,230,.09);
}

.progress-fill,
.nuit-progress-fill {
  background: linear-gradient(90deg, #edc875, #d7a955, #94672d);
  box-shadow: 0 0 18px rgba(215,169,85,.24);
}

.nav-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(215,169,85,.14);
  background:
    linear-gradient(180deg, rgba(4,18,43,.78), rgba(2,11,28,.98)),
    rgba(2,11,28,.96);
  box-shadow: 0 -14px 34px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.03);
  backdrop-filter: blur(18px);
  overflow: visible;
}

.nav-item {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  border: 0;
  border-top: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(244,239,230,.58);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px;
  font: 600 14px/1 "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.nav-item:hover {
  color: rgba(244,239,230,.82);
}

.nav-item.active {
  color: var(--nuit-gold-bright);
  border-top: 0;
  background: rgba(255,255,255,.035);
}

.nav-icon-wrap {
  display: block;
  width: 31px;
  height: 31px;
}

.nav-item span:last-child {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.04;
  white-space: normal;
}

.nuit-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.nuit-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nuit-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.56);
  backdrop-filter: blur(4px);
}

.nuit-menu-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 8px);
  max-width: 430px;
  max-height: min(72vh, 620px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(215,169,85,.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 0%, rgba(215,169,85,.12), transparent 32%),
    linear-gradient(145deg, rgba(8,30,64,.98), rgba(3,14,34,.98));
  box-shadow: 0 28px 80px rgba(0,0,0,.58), inset 0 0 0 1px rgba(255,255,255,.035);
  transform: translateY(16px);
  transition: transform .22s ease;
}

.nuit-menu-overlay.open .nuit-menu-sheet {
  transform: translateY(0);
}

.nuit-menu-grip {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(244,239,230,.18);
  margin: 10px auto 2px;
}

.nuit-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}

.nuit-menu-head h2 {
  margin-top: 4px;
  text-align: left;
  font-size: 28px;
  letter-spacing: 0;
}

.nuit-menu-close {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(215,169,85,.24);
  background: rgba(255,255,255,.035);
  color: rgba(244,239,230,.72);
  font-size: 24px;
  cursor: pointer;
}

.nuit-menu-grid {
  display: grid;
  gap: 9px;
  max-height: calc(min(72vh, 620px) - 96px);
  padding: 0 12px 14px;
  overflow-y: auto;
}

.nuit-menu-link {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(215,169,85,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
  text-decoration: none;
  color: var(--nuit-text);
}

.nuit-menu-icon {
  width: 48px;
  height: 48px;
}

.nuit-menu-text strong,
.nuit-menu-text small {
  display: block;
}

.nuit-menu-text strong {
  font-size: 20px;
  line-height: 1.05;
  color: var(--nuit-text);
}

.nuit-menu-text small {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--nuit-text-muted);
}

.nuit-menu-open {
  overflow: hidden;
}

.install-banner {
  border-radius: 22px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255,255,255,.1), transparent 30%),
    linear-gradient(145deg, rgba(8,30,64,.98), rgba(3,14,34,.98));
}

@media (min-width: 768px) {
  body {
    padding-left: 18px;
    padding-bottom: calc(var(--nav-height) + 30px);
  }

  .nav-bar {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    justify-content: initial;
    border-right: 0;
    border-top: 1px solid rgba(215,169,85,.14);
  }

  .nav-item {
    border-left: 0;
  }

  .nav-item.active {
    border-left: 0;
  }

  .nav-item span:last-child {
    display: block;
  }

  .install-banner {
    left: 24px;
    right: 24px;
    bottom: calc(var(--nav-height) + 18px);
  }
}

@media (max-width: 380px) {
  body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-bar {
    padding-left: 6px;
    padding-right: 6px;
  }

  .nav-item {
    font-size: 12.5px;
    min-height: 64px;
  }

  .nav-icon-wrap {
    width: 28px;
    height: 28px;
  }

  .nuit-menu-link {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .nuit-menu-icon {
    width: 44px;
    height: 44px;
  }
}

