@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800;900&display=swap');

:root{
  --teal:#2f8a98;
  --teal-dark:#1f6d79;
  --pink:#e8a2ba;

  --bg:#f4f7f8;
  --card:#ffffff;
  --text:#253645;
  --muted:#6f7f86;

  --border: rgba(47,138,152,.14);
  --shadow: 0 18px 50px rgba(30, 90, 105, .10);
  --shadow-strong: 0 22px 70px rgba(30, 90, 105, .16);

  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 16px;

  --ring: 0 0 0 4px rgba(47,138,152,.14);
}

*{ box-sizing:border-box; font-family:'Inter', sans-serif; }
html, body { height: 100%; }

body{
  margin:0;
  color: var(--text);
  line-height:1.7;
  overflow-x:hidden;

  background:
    radial-gradient(900px 420px at 82% -10%, rgba(232,162,186,.18), transparent 60%),
    radial-gradient(900px 520px at 16% 0%, rgba(47,138,152,.16), transparent 60%),
    linear-gradient(180deg, #f9fcfd 0%, var(--bg) 55%, #f3f7f8 100%);
  background-attachment: fixed;

  position: relative;
  z-index: 0;
}

/* Pattern */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events:none;
  opacity:.22;
  background-image: radial-gradient(rgba(47,138,152,.11) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(closest-side at 50% 18%, black 0%, transparent 85%);
  z-index: -3;
}

/* Ramadan decor */
.ramadan-decor{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.ramadan-decor .decor{
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.12));
  opacity: .98;
}

.ramadan-decor .moon{
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(92px, 9vw, 128px);
  height: auto;
}

.ramadan-decor .lantern{
  top: 110px;
  width: clamp(90px, 10.5vw, 140px);
  height: auto;
}

/* ✅ Opposite positioning (mirrored) */
.ramadan-decor .lantern-left{ right: 18px; left: auto; }
.ramadan-decor .lantern-right{ left: 18px; right: auto; }

/* Page layout */
.page{
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 20px 28px;
  position: relative;
  z-index: 1;
}

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.btn-music{
  background: rgba(255,255,255,.9);
  color: var(--teal-dark);
  border-color: rgba(47,138,152,.22);
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
  gap: 10px;
}

.btn-music:hover{
  transform: translateY(-2px);
  background: rgba(47,138,152,.07);
  box-shadow: 0 14px 30px rgba(0,0,0,.07);
}

.btn-music.is-on{
  border-color: rgba(232,162,186,.60);
  background: rgba(232,162,186,.10);
  color: #b15478;
}

.music-ico{
  display:inline-grid;
  place-items:center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(0,0,0,.04);
  font-size: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

.brand-logo{
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.10));
}

.brand-text{ min-width: 0; }
.brand-title{
  font-weight: 900;
  font-size: 1.1rem;
  background: linear-gradient(90deg, var(--teal), #f7c85c);
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
}
.brand-sub{
  color: var(--muted);
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.topbar-actions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 11px 14px;
  border-radius: 16px;
  font-weight: 900;
  font-size: .98rem;
  text-decoration:none;
  border: 2px solid transparent;
  cursor:pointer;
  user-select:none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.btn:active{ transform: scale(.99); }

.btn-primary{
  background: linear-gradient(180deg, rgba(47,138,152,1) 0%, rgba(31,109,121,1) 120%);
  color: #fff;
  box-shadow: 0 14px 26px rgba(47,138,152,.22);
}
.btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(47,138,152,.26);
}

.btn-soft{
  background: rgba(255,255,255,.9);
  color: #b15478;
  border-color: rgba(232,162,186,.55);
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
}
.btn-soft:hover{
  transform: translateY(-2px);
  background: rgba(232,162,186,.08);
  box-shadow: 0 14px 30px rgba(0,0,0,.07);
}

/* Hero card */
.hero-card{
  margin-top: 16px;
  display:grid;
  grid-template-columns: 1.4fr .6fr;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  position: relative;
  overflow:hidden;
}

.hero-title{
  margin: 0;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
}

.hero-desc{
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.hero-stats{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat{
  border-radius: 18px;
  border: 1px solid rgba(47,138,152,.14);
  background: rgba(47,138,152,.06);
  padding: 12px;
  text-align:center;
}

.stat-num{
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--teal-dark);
}

.stat-label{
  margin-top: 2px;
  font-weight: 800;
  color: var(--muted);
  font-size: .9rem;
}

.hero-badge{
  height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(232,162,186,.30);
  background: rgba(232,162,186,.10);
  padding: 14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.hero-badge-title{
  font-weight: 900;
  color: #b15478;
}

.hero-badge-text{
  margin-top: 6px;
  color: #6b4b57;
  font-weight: 800;
}

/* Section */
.content{ margin-top: 16px; }

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 10px;
  margin: 14px 2px 12px;
}

.section-title{
  margin:0;
  font-weight: 900;
  font-size: 1.2rem;
}

.section-sub{
  margin:0;
  color: var(--muted);
  font-weight: 700;
}

/* Editions grid */
.editions-grid{
  display:grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.edition-card{
  text-decoration:none;
  color: inherit;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(0,0,0,.06);
  padding: 16px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.edition-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(232,162,186,.55);
  background: rgba(255,255,255,.94);
}

.edition-top{
  position: relative;
  z-index: 1;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}

.edition-name{
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--teal-dark);
}

.edition-subline{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: .92rem;
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
}

.dot-sep{ opacity:.55; }

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .85rem;
  border: 1px solid rgba(47,138,152,.18);
  background: rgba(47,138,152,.08);
  color: var(--teal-dark);
  white-space: nowrap;
}

.badge-active{
  border-color: rgba(232,162,186,.55);
  background: rgba(232,162,186,.16);
  color: #b15478;
}

.pill-row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill{
  display:flex;
  gap: 8px;
  align-items:center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(47,138,152,.14);
  background: rgba(47,138,152,.06);
}

.pill-k{
  color: var(--muted);
  font-weight: 800;
  font-size: .9rem;
}
.pill-v{
  color: var(--text);
  font-weight: 900;
  font-size: .95rem;
}

.edition-footer{
  position: relative;
  z-index: 1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top: 12px;
  color: var(--teal-dark);
  font-weight: 900;
}

.arrow{
  display:inline-grid;
  place-items:center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(47,138,152,.10);
  transition: transform .18s ease, background .18s ease;
}

/* ✅ Opposite hover direction (was translateX(-2px)) */
.edition-card:hover .arrow{
  transform: translateX(2px);
  background: rgba(47,138,152,.14);
}

/* Footer */
.footer{
  margin-top: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  color: rgba(0,0,0,.45);
  font-weight: 800;
}
.footer-sep{ opacity:.4; }
.muted-footer{ color: rgba(0,0,0,.38); }

/* Focus */
:focus-visible{
  outline: none;
  box-shadow: var(--ring);
  border-radius: 14px;
}

/* Responsive */
@media (max-width: 980px){
  .editions-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-sub{ max-width: 380px; }
  .hero-card{ grid-template-columns: 1fr; }
}

@media (max-width: 620px){
  .page{ padding-top: 142px; }
  .topbar{ flex-direction: column; align-items: stretch; }
  .topbar-actions{ justify-content: stretch; }
  .btn{ width: 100%; }

  .editions-grid{ grid-template-columns: 1fr; }
  .section-head{ flex-direction: column; align-items:flex-start; }

  /* ✅ mirrored mobile offsets */
  .ramadan-decor .lantern-left{ right: -12px; left: auto; }
  .ramadan-decor .lantern-right{ left: -12px; right: auto; }
  .ramadan-decor .lantern{ top: 100px; }
  .ramadan-decor .moon{ top: 12px; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; }
}

/* --- Result page extras you already had --- */

.result-grid{
  margin-top: 16px;
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 14px;
}
@media (max-width: 980px){
  .result-grid{ grid-template-columns: 1fr; }
}

.result-card{
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow:hidden;
}

.quds-reveal{
  margin-top: 12px;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,.06);
  overflow:hidden;
  position: relative;
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
  min-height: 290px;
}

.quds-photo{
  position:absolute;
  inset:0;
  background-image: url("img/quds.jpg");
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.02);
}

.quds-glass{
  position:absolute;
  inset:0;
  backdrop-filter: blur(var(--blur, 12px));
  background: rgba(255,255,255,.08);
  transition: backdrop-filter .8s cubic-bezier(.2,.8,.2,1);
}

/* ✅ badge on the right (opposite) */
.quds-badge{
  position:absolute;
  bottom: 12px;
  right: 12px;
  left: auto;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.06);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
  font-weight: 900;
}

/* =========================
   Puzzle Reveal (dynamic pieces) - EN Result
   ========================= */

.puzzle{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.35);
  box-shadow: 0 18px 50px rgba(0,0,0,.10);
}

.puzzle-grid{
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  grid-template-rows: repeat(var(--rows, 3), 1fr);
  gap: 0;
  padding: 0;
}

.puzzle-piece{
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.puzzle-piece.is-revealed{
  background-image: var(--puzzle-url);
  background-repeat: no-repeat;
  background-size: calc(var(--cols,4) * 100%) calc(var(--rows,3) * 100%);
  background-position:
    calc(var(--col) * 100% / (max(1, (var(--cols,4) - 1))))
    calc(var(--row) * 100% / (max(1, (var(--rows,3) - 1))));
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}

.puzzle--result{
  margin-top: 10px;
}

.puzzle::after{
  content:"";
  position:absolute;
  inset:-60px;
  background: radial-gradient(circle at 30% 10%, rgba(255,255,255,.35), transparent 55%);
  pointer-events:none;
}