:root {
  --bg: #05261f;
  --emerald: #0a3d31;
  --emerald-dark: #062b22;
  --emerald-sil: #073228;
  --gold: #e7d874;
  --gold-deep: #c99738;
  --teal-dome: #10b981;
  --sand-1: #d99132;
  --sand-2: #ebb252;
  --text-main: #ffffff;
  --text-muted: #cce3dc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 50% 18%, #0f5243 0%, #05261f 75%, #031a15 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 10px 36px;
  -webkit-font-smoothing: antialiased;
}

#app-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #05261f;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#app-loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.ram-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(231, 216, 116, 0.2); border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile-First Poster Shell */
.poster-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, #0b4638 0%, #093b2f 65%, #073127 100%);
  border: 1.5px solid rgba(231, 216, 116, 0.35);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
  animation: posterEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes posterEnter {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Floating Golden Particles */
.sparkle-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden;
}
.sparkle {
  position: absolute;
  width: 4px; height: 4px; border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 8px #fde68a;
  opacity: 0;
  animation: floatSparkle 6s ease-in-out infinite;
}
.sparkle.s1 { left: 18%; top: 55%; animation-delay: 0s; }
.sparkle.s2 { left: 78%; top: 48%; animation-delay: 1.4s; }
.sparkle.s3 { left: 32%; top: 34%; animation-delay: 2.6s; width: 3px; height: 3px; }
.sparkle.s4 { left: 66%; top: 28%; animation-delay: 3.8s; width: 3px; height: 3px; }
.sparkle.s5 { left: 50%; top: 62%; animation-delay: 4.9s; }
@keyframes floatSparkle {
  0%, 100% { opacity: 0; transform: translateY(8px) scale(0.7); }
  50% { opacity: 0.85; transform: translateY(-18px) scale(1.2); }
}

/* Top Geometric Corner Brackets + 4 Swaying Lanterns */
.top-art-svg {
  position: relative; z-index: 2;
  width: 100%; height: 155px; display: block;
}
.lantern-outer-l { transform-origin: 46px 0px; animation: swayL 3.8s ease-in-out infinite; }
.lantern-inner-l { transform-origin: 102px 0px; animation: swayL 3.2s ease-in-out infinite 0.4s; }
.lantern-inner-r { transform-origin: 328px 0px; animation: swayL 3.2s ease-in-out infinite reverse 0.4s; }
.lantern-outer-r { transform-origin: 384px 0px; animation: swayL 3.8s ease-in-out infinite reverse; }
@keyframes swayL {
  0%, 100% { transform: rotate(-4.5deg); }
  50% { transform: rotate(4.5deg); }
}

/* Hero Typography */
.hero-copy {
  position: relative; z-index: 3;
  text-align: center;
  padding: 0 22px;
  margin-top: -78px;
}
.brand-kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.85); text-transform: uppercase;
}
.marhaban-sub {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.08rem; letter-spacing: 0.16em;
  color: #ffffff; margin-top: 8px;
}
.ramadhan-hero {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.75rem; font-weight: 700; line-height: 1.05;
  color: var(--gold);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  margin: 2px 0 8px;
  animation: fadeUp 0.8s ease 0.15s both;
}
.hero-ayat {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.45;
  max-width: 310px; margin: 0 auto 10px;
}
.hijri-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.18em;
  color: #ffffff; padding: 4px 14px;
  border-top: 1px solid rgba(231, 216, 116, 0.45);
  border-bottom: 1px solid rgba(231, 216, 116, 0.45);
}

/* Floating Crescent Moon */
.moon-stage {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 10px auto 12px;
}
.crescent-anim {
  animation: moonFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(231, 216, 116, 0.45));
}
@keyframes moonFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}
.countdown-pill {
  background: rgba(5, 38, 31, 0.78);
  border: 1px solid rgba(231, 216, 116, 0.45);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.75rem; font-weight: 700; color: var(--gold);
  display: inline-flex; align-items: center; gap: 7px;
}

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

/* Compact Glass Login Box */
.login-glass {
  position: relative; z-index: 4;
  margin: 0 16px;
  padding: 16px;
  background: rgba(5, 34, 27, 0.76);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(231, 216, 116, 0.32);
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  animation: fadeUp 0.8s ease 0.25s both;
}

.ram-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px; border-radius: 12px; margin-bottom: 12px;
}
.ram-tab-btn {
  border: none; background: transparent; color: var(--text-muted);
  padding: 8px 4px; border-radius: 9px; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: all 0.2s;
}
.ram-tab-btn.active {
  background: linear-gradient(135deg, #f3e57c, #c99738);
  color: #05261f;
}

.ram-field { margin-bottom: 10px; }
.ram-label { display: block; font-size: 0.76rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.ram-input-wrap { position: relative; display: flex; align-items: center; }
.ram-input-icon { position: absolute; left: 13px; color: var(--gold); font-size: 0.88rem; pointer-events: none; }
.ram-input {
  width: 100%; background: rgba(3, 24, 19, 0.75); border: 1px solid rgba(231, 216, 116, 0.25);
  color: #ffffff; border-radius: 12px; padding: 10px 12px 10px 38px;
  font-size: 0.88rem; outline: none; transition: border-color 0.2s;
}
.ram-input::placeholder { color: rgba(204, 227, 220, 0.5); }
.ram-input:focus { border-color: var(--gold); }
.ram-eye-btn { position: absolute; right: 8px; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; }

.btn-ram-gold {
  width: 100%; border: none; border-radius: 12px; padding: 11px 16px;
  background: linear-gradient(135deg, #f3e57c, #c99738); color: #05261f;
  font-size: 0.9rem; font-weight: 800; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(201, 151, 56, 0.35);
  transition: transform 0.15s ease;
}
.btn-ram-gold:active { transform: scale(0.98); }

.btn-ram-outline {
  width: 100%; border: 1px solid rgba(231, 216, 116, 0.4); border-radius: 12px; padding: 9px 14px;
  background: rgba(231, 216, 116, 0.12); color: var(--gold); font-size: 0.82rem; font-weight: 700;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}

.btn-ram-danger {
  width: 100%; border: 1px solid rgba(248, 113, 113, 0.4); border-radius: 12px; padding: 11px 14px;
  background: rgba(239, 68, 68, 0.16); color: #fca5a5; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

.ram-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(239, 68, 68, 0.18); border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca; padding: 9px 11px; border-radius: 10px; font-size: 0.8rem; margin-bottom: 10px;
}

.ram-divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.68rem; font-weight: 700; margin: 10px 0; }
.ram-divider::before, .ram-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.16); }

.ram-scanner { text-align: center; padding: 14px; background: rgba(3,24,19,0.65); border: 1px dashed rgba(231,216,116,0.45); border-radius: 12px; margin-bottom: 10px; }
.ram-viewfinder { width: 96px; height: 96px; margin: 0 auto 8px; border: 2px solid var(--gold); border-radius: 12px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.ram-laser { position: absolute; left: 0; right: 0; height: 2px; background: var(--gold); animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 12%; } 50% { top: 88%; } }

.quick-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.quick-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  border-radius: 11px; padding: 8px 10px;
  font-size: 0.76rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.quick-btn i { color: var(--gold); }

.ram-meta-box {
  margin-top: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.72rem; color: var(--text-muted);
}
.ram-meta-box strong { color: #ffffff; font-family: ui-monospace, monospace; }

/* Bottom Animated Desert & Mosque Scene */
.bottom-scene-svg {
  position: relative; z-index: 2;
  display: block; width: 100%; height: auto;
  margin-top: -10px;
}
.palm-sway { transform-origin: bottom center; animation: palmWind 4.5s ease-in-out infinite; }
.palm-sway-r { transform-origin: bottom center; animation: palmWind 4.5s ease-in-out infinite reverse 0.8s; }
@keyframes palmWind {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2.5deg); }
}

/* Slide-up Modals / Drawers */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 16, 12, 0.78); backdrop-filter: blur(6px);
  display: none; align-items: flex-end; justify-content: center; padding: 12px;
}
.modal-backdrop.open { display: flex; }
@media (min-width: 600px) { .modal-backdrop { align-items: center; } }
.modal-ram {
  width: 100%; max-width: 410px; max-height: 85vh; overflow-y: auto;
  background: #083329; border: 1.5px solid rgba(231, 216, 116, 0.4);
  border-radius: 22px; padding: 18px; color: #ffffff;
  box-shadow: 0 24px 48px rgba(0,0,0,0.55);
  animation: fadeUp 0.25s ease;
}
.ctrl-btn {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08);
  color: #ffffff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.prayer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.prayer-tile {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(231,216,116,0.22);
  border-radius: 10px; padding: 8px; text-align: center;
}
.prayer-name { font-size: 0.7rem; color: var(--text-muted); }
.prayer-val { font-family: ui-monospace, monospace; font-size: 0.9rem; font-weight: 800; color: var(--gold); }

.ram-pkg-grid { display: grid; gap: 9px; margin-bottom: 12px; }
.ram-pkg-card {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(231,216,116,0.25);
  border-radius: 12px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer;
}
.ram-pkg-badge { display: inline-block; font-size: 0.64rem; font-weight: 800; padding: 2px 7px; border-radius: 9999px; background: rgba(231,216,116,0.16); color: var(--gold); margin-bottom: 3px; }
.qris-white { background: #ffffff; padding: 10px; border-radius: 14px; display: inline-block; margin: 12px 0; }
.qris-white img { width: 180px; height: 180px; object-fit: contain; display: block; }

.wa-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  width: 50px; height: 50px; border-radius: 50%; border: none;
  background: #25d366; color: #ffffff; font-size: 1.45rem;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
