/* 33.islamictimes.net — tasbih. Ring sections: Bronze / Silver / Gold. Progress: green=done, red=not done. */
@font-face { font-family: 'Amiri'; src: url('/fonts/Amiri-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --bg: #0a0a00;
  --gold: #c9a84c;
  --gold-bright: #f0c040;
  --gold-muted: #7a6a30;
  --gold-dim: #3a3020;
  --label: #9a8845;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Amiri', 'Traditional Arabic', serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--gold);
  font-family: var(--font-body); overscroll-behavior: none;
}
body { min-height: 100dvh; display: flex; flex-direction: column; justify-content: safe center; gap: clamp(14px, 3vh, 26px); padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 12px); -webkit-user-select: none; user-select: none; touch-action: manipulation; }

.topbar { flex-shrink: 0; padding: 0; display: flex; justify-content: center; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-top, .logo-bottom { font-family: Georgia, serif; font-weight: bold; font-size: 0.72rem; letter-spacing: 0.24em; color: var(--gold); display: block; }
.logo-line { width: 100%; height: 1px; background: var(--gold-muted); opacity: 0.7; margin: 2px 0; display: block; border: none; }
.brand-ar { font-family: var(--font-ar); font-size: clamp(1.15rem, 5vw, 1.6rem); color: var(--gold-muted); line-height: 1; margin-bottom: 4px; }
.brand { margin: 0; font-family: var(--font-body); font-size: clamp(2rem, 9.5vw, 2.9rem); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-bright); line-height: 1; }

.wrap { flex: 0 1 auto; width: 100%; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 16px); }

.prayer-name { font-size: clamp(1rem, 4.6vw, 1.3rem); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); min-height: 22px; text-align: center; }

.tap-zone {
  position: relative;
  width: min(80vw, 56vh, 360px);
  height: min(80vw, 56vh, 360px);
  border-radius: 50%;
  background: radial-gradient(circle at center, #161204 0%, #0a0a00 72%);
  display: flex; align-items: center; justify-content: center;
}
#ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#ring-prog { transition: stroke-dashoffset 0.18s ease-out, stroke 0.3s ease; }
#ring.no-anim #ring-prog { transition: none; }
.centre { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 17%; text-align: center; }
.centre.swap { animation: centreSwap 0.3s ease; }
@keyframes centreSwap { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.dhikr-ar { font-family: var(--font-ar); font-size: clamp(2.1rem, 9.5vw, 3rem); line-height: 1.15; color: #db7d3c; }
.dhikr-tr { font-size: clamp(0.85rem, 3.4vw, 1.05rem); letter-spacing: 0.06em; color: var(--gold); }
.dhikr-count { font-family: var(--font-body); font-weight: 600; font-size: clamp(1.7rem, 7.5vw, 2.4rem); line-height: 1; color: #db7d3c; margin-top: 4px; font-variant-numeric: tabular-nums; }

.section-dots { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.sec-dot { display: flex; align-items: center; gap: 7px; opacity: 0.5; transition: opacity 0.25s; }
.sec-dot.active, .sec-dot.done { opacity: 1; }
.sec-pip { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--gold-dim); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; line-height: 1; }
.sec-dot.active .sec-pip { box-shadow: 0 0 0 3px rgba(255,255,255,0.08); }
.sec-lab { font-size: 12px; letter-spacing: 0.03em; color: var(--gold); }

.prayer-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pr-dot { display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: 0.5; transition: opacity 0.25s; }
.pr-dot.current, .pr-dot.done { opacity: 1; }
.pr-pip { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--gold-dim); background: transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #0a0a00; font-weight: 700; }
.pr-dot.done .pr-pip { background: var(--gold); border-color: var(--gold); }
.pr-dot.current .pr-pip { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(240,192,64,0.14); }
.pr-pip.pulse { animation: prPulse 0.85s ease-out; }
@keyframes prPulse { 0% { box-shadow: 0 0 0 0 rgba(240,192,64,0.55); } 100% { box-shadow: 0 0 0 16px rgba(240,192,64,0); } }
.pr-lab { font-size: 11px; letter-spacing: 0.04em; color: var(--label); }
.pr-dot.current .pr-lab { color: var(--gold); }

.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ctl { font-family: var(--font-body); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; color: #0a0a00; background: var(--gold); border: none; padding: 9px 20px; border-radius: 999px; cursor: pointer; touch-action: manipulation; }
.ctl.ghost { background: transparent; color: var(--label); border: 1px solid var(--gold-dim); }
.ctl:active { transform: scale(0.97); }

.stats-panel { width: 100%; display: none; flex-direction: column; gap: 16px; }
body.stats-open .stats-panel { display: flex; }
body.stats-open .wrap { display: none; }
body.stats-open .footer { padding-top: 18px; }
body.stats-open .controls { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding-top: 12px; padding-bottom: calc(env(safe-area-inset-bottom) + 6px); box-shadow: 0 -12px 18px -8px var(--bg); }
.st-block { border: 1px solid var(--gold-dim); border-radius: 14px; padding: 14px; }
.st-head { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--label); margin-bottom: 3px; display: flex; justify-content: space-between; align-items: baseline; }
.st-pct { color: var(--gold); font-weight: 700; letter-spacing: 0; }
.st-sub { font-size: 12px; color: var(--gold); margin-bottom: 12px; }
.pb-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--gold-dim); }
.pb-row:first-of-type { border-top: none; }
.pb-name { font-size: 14px; color: var(--gold-bright); }
.pb-stat { display: flex; align-items: baseline; gap: 12px; }
.pb-count { font-size: 13px; color: var(--label); font-variant-numeric: tabular-nums; }
.pb-pct { font-size: 14px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.pb-total { border-top: 1px solid var(--gold-muted); margin-top: 4px; padding-top: 10px; }
.pb-total .pb-name { color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
.pb-total .pb-count { color: var(--gold); }
.pb-total .pb-pct { color: var(--gold-bright); font-size: 15px; }

.bwall { display: grid; gap: 3px; align-items: center; justify-items: center; }
.brow-lab { font-size: 11px; font-weight: 600; color: var(--label); line-height: 1; }
.brick { width: 100%; max-width: 30px; aspect-ratio: 1; border-radius: 2px; min-height: 8px; }
.bcol-lab { font-size: 9px; color: var(--label); line-height: 1; padding-top: 2px; }

.footer { flex-shrink: 0; width: 100%; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-top: 0; }
.centre.gate .dhikr-count { font-size: clamp(0.85rem, 3.6vw, 1.05rem); font-weight: 500; letter-spacing: 0.04em; }
.centre.gate .dhikr-ar { font-size: clamp(2.4rem, 11vw, 3.4rem); }

.gate-bar { display: none; justify-content: center; width: 100%; }
body.gated .gate-bar { display: flex; }
.gate-btn { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; letter-spacing: 0.02em; color: #0a0a00; background: var(--gold-bright); border: none; padding: 15px 34px; border-radius: 999px; cursor: pointer; touch-action: manipulation; animation: gatePulse 1.5s ease-in-out infinite; }
.gate-btn:disabled { opacity: 0.45; animation: none; }
.gate-btn:active { transform: scale(0.97); }
@keyframes gatePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240,192,64,0.45); } 50% { box-shadow: 0 0 0 12px rgba(240,192,64,0); } }

body.stats-open, body.duas-open { justify-content: flex-start; }



/* 33 progress: per-day prayer count */
.dgrid { display: grid; gap: 6px; }
.dgrid.wk { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dgrid.mo { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dcell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dbox { width: 100%; aspect-ratio: 1; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-family: var(--font-body); font-weight: 700; font-size: clamp(12px, 4vw, 16px); color: #0a0a00; line-height: 1; }
.dlab { font-size: 10px; font-weight: 600; color: var(--label); line-height: 1; }
.ps-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.ps-row:last-child { margin-bottom: 0; }
.ps-lab { font-size: 11px; font-weight: 700; color: var(--label); width: 12px; text-align: center; flex-shrink: 0; }
.ps-strip { display: flex; gap: 2px; flex: 1; min-width: 0; }
.ps-cell { flex: 1; height: 16px; border-radius: 2px; min-width: 0; }
.ps-g { background: #34c759; }
.ps-r { background: #e5484d; }
.ps-n { background: #1a1509; }

.ywrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.yblock { display: flex; flex-direction: column; gap: 4px; }
.ylab { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); line-height: 1; }
.ygrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.ycell { width: 100%; aspect-ratio: 1; border-radius: 2px; min-height: 5px; }
.yleg { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--label); margin-top: 12px; flex-wrap: wrap; }
.yleg .lg { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.it-streak { position: fixed; top: calc(env(safe-area-inset-top) + 8px); right: 10px; z-index: 60; display: none; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(201, 168, 76, 0.10); border: 1px solid var(--gold-dim); color: var(--gold-bright); font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
body.stats-open .it-streak, body.duas-open .it-streak { display: none !important; }
/* stability v1 */
.dua-count { white-space: nowrap; }
/* privacy note v1 */
.privacy-note { max-width: min(92vw, 440px); margin: 10px auto 0; font-size: 0.72rem; line-height: 1.5; color: #7a6a30; text-align: center; }

/* consistent header v3, audio-verbatim centred title */
.site-header { position: fixed; top: 0; left: 0; right: 0; height: calc(env(safe-area-inset-top, 0px) + 36px); background: var(--bg); border-bottom: 1px solid var(--gold-dim); z-index: 100; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.header-inner { width: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; flex: 1; }
.header-row-top { display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; flex: 1; }
.back-link { display: flex; align-items: center; gap: 0.4rem; color: var(--gold-muted); text-decoration: none; -webkit-text-decoration: none; border: none; outline: none; flex-shrink: 0; padding: 0.25rem 0; -webkit-tap-highlight-color: transparent; transition: color 0.2s; }
.back-link:hover, .back-link:active { color: var(--gold-bright); }
.back-link:visited { color: var(--gold-muted); }
.back-link:focus { outline: none; }
.site-header .logo-top, .site-header .logo-bottom { font-size: 0.58rem; letter-spacing: 0.2em; }
.header-title { font-family: Georgia, serif; font-size: 0.82rem; font-weight: bold; letter-spacing: 0.06em; color: var(--gold-bright); white-space: nowrap; position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; }
body { padding-top: calc(env(safe-area-inset-top, 0px) + 44px); }
.it-streak { z-index: 120; }
/* streak pill header-aligned v1 */
.it-streak { top: calc(env(safe-area-inset-top, 0px) + 6px); right: 1.25rem; padding: 4px 9px; font-size: 0.72rem; }
