:root {
  color-scheme: dark;
  --ink: #f7f4ea;
  --muted: #c8c0ad;
  --soft: rgba(255, 255, 255, 0.12);
  --panel: rgba(10, 18, 26, 0.74);
  --panel-strong: rgba(9, 15, 23, 0.88);
  --gold: #e8c46b;
  --teal: #5fd5c4;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(5, 8, 13, 0.28), rgba(5, 8, 13, 0.82)),
    url("assets/quran-bg.png") center / cover fixed,
    #09111a;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.ayah-panel {
  width: min(740px, 100%);
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 38%),
    var(--panel);
  box-shadow: 0 26px 70px var(--shadow);
  backdrop-filter: blur(18px);
}

.top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.title-after {
  margin: 10px 0 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.9rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.streak-card {
  min-width: 174px;
  padding: 12px 14px;
  border: 1px solid rgba(232, 196, 107, 0.38);
  border-radius: 8px;
  background: rgba(232, 196, 107, 0.1);
}

.current-streak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.fire-icon {
  font-size: 1.15rem;
  filter: drop-shadow(0 0 10px rgba(232, 196, 107, 0.42));
}

.streak-number {
  color: var(--gold);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.streak-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.mini-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-stats strong {
  color: var(--teal);
}

.daily-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 26px 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.daily-meta span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--soft);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.ayah-card {
  border-radius: 8px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: clamp(18px, 4vw, 32px);
}

.arabic {
  margin: 0;
  padding: 8px 0 12px;
  font-family: Amiri, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4vw, 2.35rem);
  line-height: 2;
  direction: rtl;
  text-align: right;
}

.translation {
  margin: 22px 0 0;
  color: #eee6d3;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.7;
}

.reference {
  margin: 20px 0 0;
  color: var(--gold);
  font-weight: 800;
}

.audio-card {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.audio-card audio {
  width: 100%;
  height: 36px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.actions button,
.share-menu button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #071018;
  background: var(--gold);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.actions button:hover,
.share-menu button:hover {
  transform: translateY(-2px);
  background: #f0d98b;
}

.actions .ghost-button {
  color: var(--ink);
  border: 1px solid var(--soft);
  background: rgba(255, 255, 255, 0.08);
}

.actions .ghost-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.site-footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.heart-icon {
  color: #ff4d5d;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
}

.help-modal[hidden] {
  display: none;
}

.help-dialog {
  width: min(680px, 100%);
  max-height: min(760px, 88vh);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 22px;
  background: rgba(9, 15, 23, 0.97);
  box-shadow: 0 26px 70px var(--shadow);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.help-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-help {
  width: 38px;
  height: 38px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.help-dialog ul {
  margin: 0;
  padding-left: 22px;
  color: #eee6d3;
  line-height: 1.65;
}

.help-dialog li + li {
  margin-top: 12px;
}

.help-dialog p {
  margin: 18px 0 0;
  color: var(--teal);
  font-weight: 800;
}

.help-dialog .help-credit {
  color: var(--muted);
}

.share-wrap {
  position: relative;
}

.share-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 10;
  width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: rgba(7, 13, 20, 0.96);
  box-shadow: 0 18px 40px var(--shadow);
}

.share-menu[hidden] {
  display: none;
}

.copy-submenu {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(95, 213, 196, 0.28);
  border-radius: 8px;
  background: rgba(95, 213, 196, 0.08);
}

.copy-submenu[hidden] {
  display: none;
}

.share-menu button {
  min-height: 38px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.share-menu button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.share-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.share-menu button:disabled:hover {
  background: rgba(255, 255, 255, 0.08);
}

.share-link-field {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(95, 213, 196, 0.4);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 0.72rem;
}

.share-link-field[hidden] {
  display: none;
}

.share-status {
  min-height: 16px;
  margin: 2px 4px 0;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
}

.share-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .top-row {
    flex-direction: column;
  }

  .streak-card {
    width: 100%;
  }

  .actions button {
    flex: 1 1 160px;
  }

  .share-wrap {
    flex: 1 1 160px;
  }

  .share-wrap > button {
    width: 100%;
  }

  .share-menu {
    left: 0;
    right: auto;
    width: 100%;
  }
}
