 /* *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } */
    *, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;

  /* remove blue tap highlight */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

    :root {
      --green-deep: #0d2b1f;
      --green-mid:  #1a4a2e;
      --green-soft: #3a6b4a;
      --gold:       #c9a84c;
      --gold-light: #f5d77a;
      --gold-pale:  #e8d090;
      --beige:      #faf7f2;
      --beige-dark: #f5f0e8;
      --text-muted: #8a7a5a;
      --text-green: #2a5a38;
    }

    html, body {
      height: 100%;
      background: var(--green-deep);
    }

    body {
      font-family: 'Lato', sans-serif;
      min-height: 100svh;
      background: linear-gradient(160deg, #0d2b1f 0%, #1a3d2b 40%, #0f2318 100%);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: clamp(0.5rem, 2vh, 2rem) 1rem clamp(0.75rem, 3vh, 3rem);
      position: relative;
      overflow-x: hidden;
      overflow-y: auto;
    }

    /* geometric trellis background */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      opacity: 0.045;
      background-image:
        repeating-linear-gradient(60deg,  #c9a84c 0, #c9a84c 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(-60deg, #c9a84c 0, #c9a84c 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(0deg,   #c9a84c 0, #c9a84c 1px, transparent 1px, transparent 60px);
      pointer-events: none;
      z-index: 0;
    }

    /* ── Arch ── */
    .arch-wrap {
      width: min(360px, 92vw);
      margin-bottom: -2px;
      position: relative;
      z-index: 1;
    }
    .arch-wrap svg { width: 100%; display: block; }

    /* ── Card ── */
    .card {
      width: min(360px, 92vw);
      background: linear-gradient(180deg, var(--beige-dark) 0%, var(--beige) 100%);
      border-radius: 0 0 24px 24px;
      padding: clamp(1rem, 3vh, 1.75rem) 2rem clamp(1.25rem, 3.5vh, 2.25rem);
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      z-index: 1;
      box-shadow: 0 32px 80px rgba(0,0,0,0.55);
    }

    .bismillah {
      font-family: 'Amiri', serif;
      font-size: clamp(16px, 4.5vw, 24px);
      color: #8b6914;
      text-align: center;
      letter-spacing: 0.02em;
    }

    .divider {
      width: 75%;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--gold), transparent);
      margin: 0.65rem 0 1rem;
    }

    .dhikr-arabic {
      font-family: 'Amiri', serif;
      font-size: clamp(16px, 4.5vw, 22px);
      color: var(--green-soft);
      text-align: center;
      direction: rtl;
    }

    .dhikr-trans {
      font-size: 11px;
      color: var(--text-muted);
      text-align: center;
      letter-spacing: 0.09em;
      text-transform: uppercase;
      margin-top: 2px;
      margin-bottom: clamp(0.5rem, 2vh, 1.4rem);
    }

    /* ── Counter ring ── */
    .ring {
      width: clamp(120px, min(42vw, 22vh), 210px);
      height: clamp(120px, min(42vw, 22vh), 210px);
      border-radius: 50%;
      background: linear-gradient(145deg, var(--green-mid), var(--green-deep));
      border: 3px solid var(--gold);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: relative;
      cursor: pointer;
      user-select: none;
      transition: transform .09s, box-shadow .09s;
      box-shadow: 0 8px 32px rgba(13,43,31,.45), inset 0 2px 8px rgba(201,168,76,.12);
    }
    .ring::before {
      content: '';
      position: absolute;
      inset: 7px;
      border-radius: 50%;
      border: 1px solid rgba(201,168,76,.22);
      pointer-events: none;
    }
    .ring:active { transform: scale(0.95); box-shadow: 0 4px 16px rgba(13,43,31,.4); }

    .ring-num {
      font-family: 'Amiri', serif;
      font-size: clamp(36px, min(12vw, 7vh), 76px);
      color: var(--gold-light);
      line-height: 1;
      font-weight: 700;
      transition: transform .13s cubic-bezier(.34,1.56,.64,1);
    }
    .ring-num.bump { transform: scale(1.2); }

    .ring-hint {
      font-size: 10px;
      color: rgba(201,168,76,.45);
      letter-spacing: .12em;
      text-transform: uppercase;
      margin-top: 4px;
    }

    /* ── Progress ── */
    .prog-wrap { width: 100%; margin: clamp(0.5rem, 2vh, 1.4rem) 0 0; }
    .prog-labels {
      display: flex;
      justify-content: space-between;
      margin-bottom: 5px;
    }
    .prog-labels span { font-size: 11px; color: var(--text-muted); }
    .prog-labels strong { font-size: 13px; color: var(--green-soft); font-weight: 700; }
    .prog-track {
      width: 100%;
      height: 6px;
      background: rgba(58,107,74,.14);
      border-radius: 99px;
      overflow: hidden;
    }
    .prog-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--green-soft), var(--gold));
      border-radius: 99px;
      transition: width .3s ease;
      width: 0%;
    }

    /* ── Bead row ── */
    .beads {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      justify-content: center;
      margin: clamp(0.4rem, 1.5vh, 1.1rem) 0 0;
      padding: 0 4px;
    }
    .bead {
      width: 13px; height: 13px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, var(--gold-pale), var(--gold) 55%, #8b6914);
      border: 1px solid rgba(255,255,255,.25);
      transition: opacity .25s, transform .15s;
      flex-shrink: 0;
    }
    .bead.off {
      background: radial-gradient(circle at 35% 35%, #d5cec2, #b5ae9f 55%, #8a8070);
      opacity: .38;
    }
    .bead.sep {
      width: 16px; height: 16px;
      background: radial-gradient(circle at 35% 35%, var(--green-soft), var(--green-mid) 55%, var(--green-deep));
      border: 1px solid rgba(201,168,76,.5);
    }
    .bead.sep.off { opacity: .3; }

    /* ── Controls ── */
    .controls {
      display: flex;
      gap: 10px;
      width: 100%;
      margin-top: clamp(0.5rem, 2vh, 1.3rem);
    }
    .btn {
      flex: 1;
      padding: 11px 6px;
      border: none;
      border-radius: 12px;
      font-family: 'Lato', sans-serif;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: .06em;
      cursor: pointer;
      transition: transform .08s, opacity .08s;
    }
    .btn:active { transform: scale(0.95); opacity: .8; }
    .btn-undo  { background: #e8e0d0; color: #6b5a3a; }
    .btn-reset {
      background: linear-gradient(135deg, var(--green-mid), var(--green-deep));
      color: var(--gold-light);
      border: 1px solid rgba(201,168,76,.35);
    }

    /* ── Dhikr selector ── */
    .dhikr-grid {
      display: grid;
      grid-template-columns: repeat(3,1fr);
      gap: 8px;
      width: 100%;
      margin-top: clamp(0.5rem, 2vh, 1.25rem);
    }
    .d-btn {
      padding: 8px 4px;
      border-radius: 10px;
      border: 1.5px solid transparent;
      background: rgba(58,107,74,.08);
      cursor: pointer;
      text-align: center;
      transition: all .14s;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
    }
    .d-btn.active { background: rgba(58,107,74,.16); border-color: var(--green-soft); }
    .d-btn:hover  { background: rgba(58,107,74,.13); }
    .d-btn .ar { font-family:'Amiri',serif; font-size: clamp(11px,3vw,14px); color: var(--text-green); direction:rtl; line-height:1.2; }
    .d-btn .ct { font-size: 10px; color: var(--text-muted); }

    /* ── Milestones ── */
    .milestones {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      justify-content: center;
      margin-top: clamp(0.4rem, 1.5vh, 1rem);
      width: 100%;
    }
    .mdot {
      width: 10px; height: 10px;
      border-radius: 50%;
      background: rgba(58,107,74,.14);
      border: 1px solid rgba(58,107,74,.2);
      transition: background .25s, transform .18s;
      flex-shrink: 0;
    }
    .mdot.done { background: var(--gold); border-color: var(--gold); transform: scale(1.15); }
    .mdot.ckpt { border-radius: 2px; background: rgba(58,107,74,.22); border-color: var(--green-soft); }
    .mdot.ckpt.done { background: var(--green-mid); border-color: var(--green-soft); }

    /* ── Stats ── */
    .stats {
      display: flex;
      gap: 1.5rem;
      justify-content: center;
      margin-top: clamp(0.4rem, 1.5vh, 1.25rem);
    }
    .stat { text-align: center; }
    .stat-n { font-family:'Amiri',serif; font-size: 22px; color: var(--green-soft); font-weight:700; line-height:1; }
    .stat-l { font-size: 10px; color: var(--text-muted); letter-spacing:.08em; text-transform:uppercase; margin-top:2px; }
    .stat-sep { width:1px; background: rgba(58,107,74,.15); align-self:stretch; }

    /* ── Complete flash ── */
    @keyframes completePulse {
      0%   { box-shadow: 0 0 0 0 rgba(201,168,76,.7), 0 8px 32px rgba(13,43,31,.4); }
      50%  { box-shadow: 0 0 0 12px rgba(201,168,76,.0), 0 8px 32px rgba(13,43,31,.4); }
      100% { box-shadow: 0 8px 32px rgba(13,43,31,.4), inset 0 2px 8px rgba(201,168,76,.12); }
    }
    .ring.celebrate { animation: completePulse .7s ease-out forwards; }

    /* ── Footer ── */
    .footer {
      margin-top: 1.6rem;
      font-size: 11px;
      color: rgba(201,168,76,.4);
      letter-spacing: .1em;
      text-align: center;
      z-index: 1;
      position: relative;
    }

    /* ── Responsive ── */
    @media (max-width: 380px) {
      .card { padding: 1.4rem 1.2rem 1.8rem; }
      .controls { gap: 8px; }
    }
    @media (min-width: 640px) {
      .arch-wrap { width: 400px; }
      .card { width: 400px; padding: 2.25rem 2.75rem 2.75rem; }
      .ring { width: 230px; height: 230px; }
    }
    @media (min-width: 1024px) {
      .arch-wrap { width: 440px; }
      .card { width: 440px; }
    }

    /* ── Height-based compression ── */
    @media (max-height: 700px) {
      .card { padding: 1.25rem 1.75rem 1.5rem; }
      .bismillah { font-size: 15px; }
      .divider { margin: 0.4rem 0 0.6rem; }
      .btn { padding: 8px 6px; font-size: 12px; }
      .d-btn { padding: 6px 4px; }
      .stat-n { font-size: 18px; }
      .footer { margin-top: 0.75rem; }
    }

    @media (max-height: 580px) {
      .beads { display: none; }
      .milestones { display: none; }
      .card { padding: 1rem 1.5rem 1.25rem; }
      .dhikr-trans { margin-bottom: 0.75rem; }
      .footer { display: none; }
    }

    @media (max-height: 480px) {
      .bismillah { display: none; }
      .divider { display: none; }
    }

    @media (max-height: 460px) {
      .stats { display: none; }
      .card { padding: 0.75rem 1.25rem 1rem; }
      .dhikr-trans { display: none; }
    }