:root {
  --night: #0a2f2c;
  --night2: #12514a;
  --gold: #c8a24d;
  --gold2: #e6cb7f;
  --ivory: #f8f4ea;
  --paper: #fff;
  --ink: #16302c;
  --mute: #60726e;
  --line: #e7e0cc;
  --bad: #b3261e;
}
* {
  box-sizing: border-box;
}
html {
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family:
    Figtree,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  line-height: 1.55;
}
a {
  color: var(--night2);
}
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
main {
  margin-top: -74px;
  position: relative;
}
.ayah {
  background: var(--paper);
  border: 1px solid var(--gold);
  border-radius: 18px;
  padding: 18px 18px 14px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(10, 47, 44, 0.15);
  min-height: 176px;
  transition: opacity 0.5s ease;
}
.ayah.fade {
  opacity: 0;
}
.ayah .ar {
  font-family:
    Amiri, "Traditional Arabic", "Noto Naskh Arabic", "Geeza Pro", serif;
  font-size: 25px;
  line-height: 1.9;
  margin: 0 0 6px;
  color: var(--night);
}
.ayah .en {
  margin: 0;
  font-size: 14px;
  color: var(--mute);
}
.ayah .ref {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #9a7a2e;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  transition: box-shadow 0.25s;
}
.card:hover {
  box-shadow: 0 6px 22px rgba(10, 47, 44, 0.08);
}
.owner {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, #fffdf5, #fff);
}
.badge {
  display: inline-block;
  background: var(--night);
  color: var(--gold2);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 99px;
}
.big {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  word-break: break-all;
  margin: 10px 0 12px;
  color: var(--night);
}
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  transition:
    transform 0.15s,
    background 0.2s,
    box-shadow 0.2s,
    opacity 0.2s;
}
button:active {
  transform: scale(0.97);
}
.btn {
  background: var(--night);
  color: #fff;
  padding: 15px 18px;
  width: 100%;
  font-size: 16px;
}
.btn:hover {
  background: var(--night2);
  box-shadow: 0 6px 16px rgba(10, 47, 44, 0.25);
}
.btn.gold {
  background: var(--gold);
  color: #241a00;
}
.btn.gold:hover {
  background: var(--gold2);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.stats {
  display: flex;
  gap: 8px;
  text-align: center;
}
.stats div {
  flex: 1;
  background: var(--ivory);
  border-radius: 12px;
  padding: 10px 4px;
}
.stats b {
  display: block;
  font-size: 21px;
  color: var(--night);
}
.stats span {
  font-size: 12px;
  color: var(--mute);
}
.bar {
  height: 8px;
  background: var(--line);
  border-radius: 9px;
  margin: 12px 0 14px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  width: 0;
  transition: width 0.5s ease;
}
h2 {
  font-size: 18px;
  margin: 0 0 10px;
  color: var(--night);
}
.hint {
  font-size: 13px;
  color: var(--mute);
  margin: 8px 0 0;
}
textarea,
input[type="text"],
input[type="search"],
input[type="password"] {
  width: 100%;
  font: inherit;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ivory);
  color: var(--ink);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
textarea {
  resize: vertical;
  min-height: 84px;
}
textarea:focus,
input:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 162, 77, 0.25);
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.tabs button {
  flex: 1;
  padding: 10px;
  background: var(--ivory);
  color: var(--mute);
  font-size: 14px;
}
.tabs button.on {
  background: var(--night);
  color: var(--gold2);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.row:first-child {
  border-top: 0;
}
.row code {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  word-break: break-all;
  color: var(--night);
}
.row small {
  color: var(--mute);
  font-size: 12px;
  white-space: nowrap;
}
.row button {
  background: var(--ivory);
  color: var(--night2);
  padding: 9px 16px;
  border: 1px solid var(--line);
}
.row button:hover {
  background: var(--gold2);
}
.row button.del {
  color: var(--bad);
}
.row.flash {
  animation: flash 1s ease;
}
@keyframes flash {
  from {
    background: rgba(200, 162, 77, 0.4);
  }
  to {
    background: transparent;
  }
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 14px;
  color: var(--mute);
}
.pager button {
  background: var(--ivory);
  color: var(--ink);
  padding: 9px 14px;
  border: 1px solid var(--line);
}
.pager button:disabled {
  opacity: 0.4;
}
.ad {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
  text-align: center;
}
.ad[hidden] {
  display: none;
}
.row.adrow {
  display: block;
  padding: 8px 0;
}
.empty {
  text-align: center;
  color: var(--mute);
  padding: 24px 0;
}
.msg {
  font-size: 14px;
  margin-top: 10px;
  min-height: 20px;
}
.msg.err {
  color: var(--bad);
}
.tea {
  background: var(--night);
  color: #fff;
  border-color: var(--night);
}
.tea h2 {
  color: var(--gold2);
}
.tea p {
  opacity: 0.9;
  margin: 0 0 10px;
  font-size: 14px;
}
.tea .row {
  border-color: rgba(255, 255, 255, 0.15);
}
.tea .row code {
  color: #fff;
  font-size: 14px;
}
.tea .row button {
  background: var(--gold);
  color: #241a00;
  border: 0;
}
.tea .row small {
  color: var(--gold2);
}
.prose p,
.prose li {
  font-size: 15px;
}
.prose h2 {
  margin-top: 20px;
}
footer {
  text-align: center;
  color: var(--mute);
  font-size: 13px;
  padding: 8px 16px 36px;
}
footer a {
  color: var(--night2);
  font-weight: 700;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0));
  transform: translate(-50%, 20px);
  background: var(--night);
  color: var(--gold2);
  padding: 12px 20px;
  border-radius: 99px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 9;
  max-width: 90vw;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.err {
  background: var(--bad);
  color: #fff;
}
.stats3 b {
  font-size: 22px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Header ===== */
header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(
      700px 380px at 82% 8%,
      rgba(200, 162, 77, 0.22),
      transparent 65%
    ),
    linear-gradient(165deg, #051a18 0%, #0a2f2c 52%, #0f463f 100%);
  padding-bottom: 124px;
}
header:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.topbar {
  position: relative;
  text-align: center;
  font-family: Amiri, "Traditional Arabic", "Noto Naskh Arabic", serif;
  font-size: 21px;
  color: var(--gold2);
  padding: 8px 16px;
  border-bottom: 1px solid rgba(200, 162, 77, 0.22);
  background: rgba(0, 0, 0, 0.22);
}
.nav {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  padding-bottom: 6px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.2px;
}
.brand svg {
  width: 38px;
  height: 38px;
  display: block;
}
.navlink {
  color: var(--gold2);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid rgba(200, 162, 77, 0.55);
  padding: 9px 18px;
  border-radius: 99px;
  transition:
    background 0.2s,
    color 0.2s;
}
.navlink:hover {
  background: var(--gold);
  color: #241a00;
}
.hero {
  position: relative;
  padding-top: 36px;
  min-height: 260px;
  animation: rise 0.8s ease both;
}
.hero-text {
  position: relative;
  z-index: 1;
  max-width: 500px;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #fff;
}
.hero p {
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.84);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 26px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  transition:
    transform 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
.cta .b1 {
  background: linear-gradient(180deg, #ddbb66, #c8a24d);
  color: #241a00;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.cta .b1:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.cta .b2 {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}
.cta .b2:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}
.trust {
  display: flex;
  margin-top: 32px;
}
.trust div {
  padding: 0 22px;
  border-left: 1px solid rgba(200, 162, 77, 0.4);
}
.trust div:first-child {
  padding-left: 0;
  border-left: 0;
}
.trust b {
  display: block;
  font-size: 23px;
  line-height: 1.15;
  color: var(--gold2);
}
.trust span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.orn {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 250px;
  height: 250px;
  animation: spin 180s linear infinite;
  pointer-events: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 760px) {
  .orn {
    display: none;
  }
  .trust div {
    padding: 0 14px;
  }
}
[id="copy"],
[id="share"] {
  scroll-margin-top: 14px;
}
/* ===== Live ticker ===== */
.live h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2fb36b;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 179, 107, 0.6);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(47, 179, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 179, 107, 0);
  }
}
.ticker {
  height: 236px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    transparent,
    #000 14%,
    #000 86%,
    transparent
  );
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}
.tk {
  animation: tkup var(--dur, 50s) linear infinite;
}
.ticker:hover .tk,
.ticker.hold .tk {
  animation-play-state: paused;
}
@keyframes tkup {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker {
    overflow: auto;
  }
  .tk {
    animation: none !important;
  }
}
/* ===== Mobile-first tuning ===== */
html {
  -webkit-text-size-adjust: 100%;
}
.row button,
.pager button,
.tabs button {
  min-height: 44px;
}

@media (max-width: 600px) {
  header {
    padding-bottom: 86px;
  }
  .topbar {
    font-size: 18px;
    padding: 6px 12px;
  }
  .nav {
    padding-top: 14px;
    padding-bottom: 0;
  }
  .brand {
    font-size: 17px;
    gap: 9px;
  }
  .brand svg {
    width: 34px;
    height: 34px;
  }
  .navlink {
    padding: 8px 14px;
    font-size: 13px;
  }
  .hero {
    padding-top: 18px;
    min-height: 0;
  }
  .hero h1 {
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
  }
  .hero p {
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 18px;
  }
  .cta {
    gap: 10px;
    flex-wrap: nowrap;
  }
  .cta a {
    flex: 1;
    height: 48px;
    padding: 0 8px;
    font-size: 15px;
  }
  .trust {
    margin-top: 20px;
  }
  .trust div {
    padding: 0 12px;
  }
  .trust b {
    font-size: 19px;
  }
  .trust span {
    font-size: 11px;
  }
  main {
    margin-top: -60px;
  }
  .ayah {
    min-height: 0;
    padding: 14px 14px 12px;
  }
  .ayah .ar {
    font-size: 22px;
    line-height: 1.8;
  }
  .ayah .en {
    font-size: 13px;
  }
  .card {
    padding: 16px;
    border-radius: 16px;
  }
  .big {
    font-size: 24px;
  }
  .row code {
    font-size: 16px;
  }
  .ticker {
    height: 210px;
  }
}

@media (max-width: 360px) {
  .hero h1 {
    font-size: 25px;
  }
  .cta a {
    font-size: 14px;
  }
  .trust div {
    padding: 0 9px;
  }
}
