/* NusukKeys — refined rebuild. Vanilla CSS, no frameworks.
   Palette kept: dark green #0b261f / #071914, gold #f2b84b, cream #f6f2e9.
   Spacing scale: --sp-1..--sp-8 (4px steps). Transitions: 150-200ms. */
:root {
  --bg: #f6f2e9;
  --surface: rgba(255, 255, 255, 0.88);
  --ink: #12211c;
  --ink-2: #4d5f58;
  --ink-3: #83948d;
  --line: rgba(18, 33, 28, 0.11);
  --line-gold: rgba(185, 137, 40, 0.28);
  --forest: #0b261f;
  --forest-2: #123a2f;
  --gold: #f2b84b;
  --gold-2: #e0a02c;
  --gold-deep: #9a6c15;
  --mint: #2fbf8f;
  --danger: #d6404f;
  --r: 18px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;
  --shadow-sm: 0 2px 8px rgba(11, 38, 31, 0.08);
  --shadow-md: 0 10px 26px -14px rgba(11, 38, 31, 0.55);
  --ease: 0.18s ease;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--forest-2); outline-offset: 2px; border-radius: 6px; }
body {
  font-family: var(--sans);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 16%, rgba(242, 184, 75, 0.22), transparent 52%),
    radial-gradient(circle at 15% 45%, rgba(185, 137, 40, 0.08), transparent 42%),
    radial-gradient(circle at 85% 45%, rgba(18, 58, 47, 0.07), transparent 42%);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Guest warning bar */
.guest-alert {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(90deg, #3a2305 0%, #241502 50%, #3a2305 100%);
  color: #fbe6b8; border-bottom: 1px solid rgba(242, 184, 75, 0.45);
  padding: var(--sp-2) 0; font-size: 0.8rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}
.guest-alert-in { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.guest-alert-text { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; line-height: 1.4; }
.warn-dot { font-size: 0.85rem; flex-shrink: 0; }
.guest-alert-btn {
  flex-shrink: 0; border: 1px solid rgba(242, 184, 75, 0.65); background: var(--gold); color: #231500;
  font: inherit; font-size: 0.74rem; font-weight: 800; padding: 5px 12px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; transition: filter var(--ease), transform var(--ease);
}
.guest-alert-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
/* Backdrop — artwork kept exactly as in the original */
.sacred-backdrop { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-ornament-top { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100%; min-width: 1200px; height: 295px; }
.bg-kaaba-scene {
  position: absolute; top: 28px; left: 50%; transform: translateX(-50%);
  width: min(1160px, 135vw); height: auto; opacity: 0.82;
  filter: drop-shadow(0 18px 38px rgba(11, 38, 31, 0.08));
}
.wrap { width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 var(--sp-6); position: relative; z-index: 1; }
/* Header */
.top { padding: var(--sp-5) 0 var(--sp-3); position: relative; z-index: 2; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.02em; font-size: 1.08rem; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--forest); color: var(--gold);
  border: 1px solid rgba(242, 184, 75, 0.4); box-shadow: 0 6px 16px rgba(11, 38, 31, 0.18);
  display: inline-grid; place-items: center; flex: none; transition: transform var(--ease), box-shadow var(--ease);
}
.logo:hover .logo-mark { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(11, 38, 31, 0.22); }
.logo-mark svg, .gate-badge svg { display: block; }
.top-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.seg { display: inline-flex; background: rgba(18, 33, 28, 0.06); border: 1px solid rgba(185, 137, 40, 0.18); border-radius: 999px; padding: 3px; gap: 2px; backdrop-filter: blur(8px); }
.seg button {
  border: 0; background: transparent; font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background var(--ease), color var(--ease), transform var(--ease);
}
.seg button:hover { color: var(--ink); transform: translateY(-1px); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.acct {
  display: inline-flex; align-items: center; gap: var(--sp-2); border: 1px solid var(--line-gold); background: var(--surface);
  font: inherit; font-family: var(--mono); font-size: 0.76rem; font-weight: 700; color: var(--ink);
  padding: 7px 13px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(8px); transition: transform var(--ease), box-shadow var(--ease);
}
.acct:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.acct-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); flex: none; }
.acct-dot.warn { background: #f59e0b; }
/* Creator credit — centred, just under the header. The name is a
   touch larger and in a deeper gold so it is clearly visible, while
   staying elegant and quiet next to the header. */
.credit { text-align: center; font-size: 0.88rem; color: var(--ink-2); margin: var(--sp-1) auto 0; }
/* Creator name — Playfair Display (upright high-contrast serif, never
   italic), 1.28rem, deep emerald on cream. It is the free look-alike
   of the Bulagria font Ahmad showed: Bulagria's free download is
   "personal use only" (commercial licence is paid), so the site uses
   Playfair Display (SIL Open Font Licence) instead. */
.credit a { font-family: 'Playfair Display', 'Bodoni Moda', Georgia, serif; font-size: 1.28rem; font-weight: 500; line-height: 1.4; color: #0a6b4e; letter-spacing: 0.01em; text-decoration: none; border-bottom: 1px solid rgba(10, 107, 78, 0.45); }
.credit a:hover { color: #085c40; border-bottom-color: #085c40; }
/* Share bar — compact row under the metrics, above the dispenser */
.share-bar { text-align: center; margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line-gold); border-radius: 14px; box-shadow: var(--shadow-sm); }
.share-msg { font-size: 0.88rem; color: var(--ink-2); font-weight: 600; margin-bottom: var(--sp-2); }
.share-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 700; color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--line-gold); border-radius: 999px; padding: 6px 12px; transition: transform var(--ease), box-shadow var(--ease); }
.share-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.share-btn .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.fb { background: #1877f2; } .dot.wa { background: #25d366; } .dot.tg { background: #229ed9; } .dot.x { background: #111; } .dot.in { background: #0a66c2; }
/* Footer expiry notice — small, quiet, under the copyright */
.expiry { font-size: 0.72rem !important; color: var(--ink-3); margin-top: var(--sp-1); }
/* Backup-mirror links in the footer — small, quiet */
.mirrors { font-size: 0.72rem !important; color: var(--ink-3); margin-top: var(--sp-1); }
.mirrors a { color: var(--ink-3); text-decoration: underline; }
/* Failover banner — shown only when this host loads no code list */
.failover { background: #fff3d6; border: 1px solid #d49b2a; color: #5c3d00; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 0.85rem; text-align: center; }
.failover a { color: #7a5200; font-weight: 700; text-decoration: underline; margin-left: 8px; }
.failover-count { display: block; margin-top: 6px; font-weight: 700; }
.failover-stay { margin: 6px 0 0 8px; background: none; border: 1px solid #7a5200; color: #7a5200; border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; cursor: pointer; }
/* Gate note (replaces the old share checkbox — adding your code to
   the pool is now automatic, not optional) */
.gate-note { font-size: 0.82rem; color: var(--ink-2); margin: var(--sp-2) 0 0; }
/* Hero — soft cream wash over the busy backdrop, for contrast */
.hero {
  padding: var(--sp-5) var(--sp-5) 22px; margin: var(--sp-1) 0 var(--sp-4);
  background: linear-gradient(rgba(246, 242, 233, 0.78), rgba(246, 242, 233, 0.55));
  border: 1px solid rgba(185, 137, 40, 0.12); border-radius: 20px;
}
.hero-ornament { display: inline-flex; align-items: center; gap: 10px; margin-bottom: var(--sp-2); color: #b58524; font-size: 0.85rem; }
.hero-ornament span { width: 36px; height: 1px; background: linear-gradient(90deg, transparent, rgba(181, 133, 36, 0.55), transparent); }
.hero-ornament i { font-style: normal; }
.hero h1 { font-size: clamp(1.85rem, 4.2vw, 2.8rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 800; max-width: 760px; }
.hero h1 #hero-total { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--gold-deep); font-size: 1.14em; }
.hero p { color: var(--ink-2); margin-top: 10px; max-width: 560px; font-size: 0.98rem; }
/* Metrics bar — equal, aligned cards */
.metrics-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, #0b261f 0%, #123a2f 100%);
  border: 1px solid rgba(242, 184, 75, 0.5); border-radius: 16px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(242, 184, 75, 0.3); overflow: hidden;
}
.metric-card { display: flex; align-items: center; gap: var(--sp-3); padding: 12px 16px; min-width: 0; min-height: 64px; }
.metric-card + .metric-card { border-inline-start: 1px solid rgba(242, 184, 75, 0.22); }
.metric-ico {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(242, 184, 75, 0.15); border: 1px solid rgba(242, 184, 75, 0.5); color: var(--gold);
}
.metric-ico.live { position: relative; }
.metric-ico.live::after {
  content: ''; position: absolute; top: -1px; inset-inline-end: -1px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 0 3px rgba(47, 191, 143, 0.28);
}
.metric-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.metric-head { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244, 239, 227, 0.72); line-height: 1.3; }
.metric-val { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }
.metric-val strong { font-family: var(--mono); font-size: 1.32rem; font-weight: 800; color: var(--gold); line-height: 1.1; text-shadow: 0 0 14px rgba(242, 184, 75, 0.4); }
.metric-val small { font-size: 0.72rem; font-weight: 600; color: rgba(244, 239, 227, 0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Language typography */
html[lang='bn'] body, html[lang='bn'] button, html[lang='bn'] input { font-family: 'Hind Siliguri', 'Plus Jakarta Sans', sans-serif; }
html[lang='ar'] body, html[lang='ar'] button, html[lang='ar'] input { font-family: 'Noto Naskh Arabic', 'Amiri', serif; line-height: 1.7; }
html[lang='ar'] .hero h1, html[lang='ar'] .disp-label, html[lang='ar'] .gate-card h2 { font-family: 'Amiri', 'Noto Naskh Arabic', serif; letter-spacing: 0; }
html[lang='ar'] .metric-head, html[lang='bn'] .metric-head, html[lang='ar'] .disp-label, html[lang='bn'] .disp-label { text-transform: none; letter-spacing: 0; }
html[lang='ar'] .metric-head { font-size: 0.8rem; }
html[lang='bn'] .hero h1, html[lang='bn'] .hero h1 span { letter-spacing: 0; line-height: 1.3; }
.disp-code, .chip, #gate-input, .metric-val strong { direction: ltr; }
/* Dispenser — premium card, art pulled back so the code never overlaps it */
.dispenser {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0b261f 0%, #071914 65%, #102e25 100%);
  color: #f4efe3; border-radius: 24px; border: 1px solid rgba(242, 184, 75, 0.34);
  padding: var(--sp-8) var(--sp-8) 26px;
  box-shadow: 0 26px 56px -22px rgba(11, 38, 31, 0.75), inset 0 1px 0 rgba(242, 184, 75, 0.25);
}
.kiswah-frieze {
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: repeating-linear-gradient(90deg, rgba(242, 184, 75, 0.25) 0, rgba(242, 184, 75, 0.85) 18px, rgba(18, 58, 47, 0.9) 18px, rgba(18, 58, 47, 0.9) 24px);
}
.disp-kaaba-art { position: absolute; right: 10px; top: 6px; width: 300px; height: 262px; pointer-events: none; opacity: 0.78; }
[dir='rtl'] .disp-kaaba-art { right: auto; left: 10px; transform: scaleX(-1); }
.disp-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); font-size: 0.8rem; position: relative; flex-wrap: wrap; }
.disp-label { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--gold); }
.disp-by { color: rgba(244, 239, 227, 0.75); display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 0.78rem; flex-wrap: wrap; }
.disp-pill {
  background: rgba(242, 184, 75, 0.16); border: 1px solid rgba(242, 184, 75, 0.35); color: var(--gold);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.disp-code {
  font-family: var(--mono); font-weight: 700; font-size: clamp(1.85rem, 6vw, 3.2rem); letter-spacing: 0.01em;
  margin: 14px 0 16px; padding-inline-end: 120px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(242, 184, 75, 0.18);
  user-select: all; position: relative; transition: transform var(--ease);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.disp-code.pop { transform: scale(1.02); }
.disp-code .pre { color: rgba(242, 184, 75, 0.55); font-weight: 500; }
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; position: relative; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--gold)); border-radius: 99px; transition: width 0.35s ease; }
.disp-stats { margin-top: 10px; font-size: 0.82rem; color: rgba(244, 239, 227, 0.75); position: relative; }
.disp-stats b { color: #fff; }
.disp-actions { display: flex; gap: 10px; margin-top: 20px; position: relative; }
.btn-cta {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #f7c762 0%, #e5a832 100%); color: #231600; font: inherit; font-weight: 800;
  font-size: 1.02rem; padding: 15px 22px; border-radius: 14px; box-shadow: 0 10px 24px -6px rgba(242, 184, 75, 0.45);
  transition: filter var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn-cta:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 14px 28px -6px rgba(242, 184, 75, 0.5); }
.btn-cta:active { transform: scale(0.99); }
.btn-cta:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-cta.full { width: 100%; flex: none; }
.btn-cta kbd { font-family: var(--mono); font-size: 0.68rem; background: rgba(42, 28, 0, 0.14); border-radius: 6px; padding: 2px 6px; }
.btn-ghost {
  border: 1px solid rgba(242, 184, 75, 0.32); background: rgba(255, 255, 255, 0.04); color: #f4efe3; font: inherit; font-weight: 700;
  padding: 0 22px; border-radius: 14px; cursor: pointer; backdrop-filter: blur(4px); transition: background var(--ease), transform var(--ease);
}
.btn-ghost:hover { background: rgba(242, 184, 75, 0.12); transform: translateY(-1px); }
.strip {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4);
  padding-top: 14px; border-top: 1px solid rgba(242, 184, 75, 0.18); font-size: 0.82rem; position: relative;
}
.strip code { font-family: var(--mono); font-weight: 700; color: var(--gold); }
.strip-links { display: flex; gap: 14px; flex-wrap: wrap; }
.strip-links button { border: 0; background: none; color: rgba(244, 239, 227, 0.8); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.strip-links button.danger:hover { color: #ff8f9a; }
.strip-links button:hover { color: #fff; }
/* Steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin: var(--sp-4) 0 34px; }
.steps li {
  display: flex; gap: var(--sp-3); background: var(--surface); border: 1px solid var(--line-gold);
  border-radius: 16px; padding: var(--sp-4); backdrop-filter: blur(8px); transition: transform var(--ease), box-shadow var(--ease);
}
.steps li:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.steps li.step-action { cursor: pointer; }
.steps li.step-action:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.steps b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(242, 184, 75, 0.22); color: #8c6110; font-size: 0.8rem; }
.steps strong { display: block; font-size: 0.88rem; }
.steps span { font-size: 0.78rem; color: var(--ink-2); }
/* Code browser */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.controls input {
  flex: 1 1 220px; min-width: 0; font: inherit; font-family: var(--mono); font-size: 0.9rem; padding: 13px 16px;
  border-radius: 14px; border: 1px solid var(--line-gold); background: var(--surface); color: var(--ink); backdrop-filter: blur(8px);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.controls input:focus, .add-form input:focus, #gate-input:focus { outline: 2px solid var(--forest-2); outline-offset: 1px; }
.btn-soft {
  border: 1px solid var(--line-gold); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 0.84rem;
  padding: 11px 16px; border-radius: 14px; cursor: pointer; transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn-soft:hover { border-color: var(--forest-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.count { font-size: 0.8rem; color: var(--ink-3); margin: var(--sp-3) 2px 10px; min-height: 1.2em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.chip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; text-align: left;
  font-family: var(--mono); font-weight: 700; font-size: 0.82rem; padding: 12px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  backdrop-filter: blur(6px); transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.chip:hover { border-color: #b98928; box-shadow: 0 4px 12px rgba(185, 137, 40, 0.12); transform: translateY(-1px); }
.chip:active { transform: scale(0.98); }
.chip .pre { color: var(--ink-3); font-weight: 500; }
.chip-right { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.chip-meta { font-size: 0.66rem; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: rgba(185, 137, 40, 0.14); color: #8c6110; }
.chip-meta.new { background: rgba(47, 191, 143, 0.16); color: #0d6e4e; }
.chip svg { flex: none; color: var(--ink-3); }
.chip.used { background: rgba(47, 191, 143, 0.1); border-color: rgba(47, 191, 143, 0.35); }
.chip.used svg { color: #0f7a58; }
.chip.flash { background: var(--gold); border-color: var(--gold-2); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-3); padding: 34px 10px; font-size: 0.9rem; }
.more { text-align: center; margin: 18px 0 8px; }
/* Share box */
.add { margin: 30px 0 10px; background: var(--surface); border: 1px solid var(--line-gold); border-radius: 16px; padding: 16px 18px; backdrop-filter: blur(8px); }
.add summary { cursor: pointer; font-weight: 700; font-size: 0.92rem; }
.add-form { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.add-form input { flex: 1; min-width: 0; font: inherit; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.btn-dark { border: 0; background: var(--forest); color: var(--gold); font: inherit; font-weight: 700; padding: 0 20px; border-radius: 12px; cursor: pointer; transition: transform var(--ease), filter var(--ease); }
.btn-dark:hover { filter: brightness(1.12); transform: translateY(-1px); }
.err { color: var(--danger); font-size: 0.82rem; margin-top: var(--sp-2); }
/* Footer — extra bottom room so nothing is clipped at the fold */
.foot { padding: 36px 20px 56px; text-align: center; color: var(--ink-3); font-size: 0.76rem; }
.foot p { max-width: 640px; margin: 0 auto; }
@media (min-width: 900px) {
  /* Desktop: the full disclaimer fits on one line; the width here is
     enough (~660px of text in ~810px+ of space), so no overflow. */
  .foot p[data-i18n="foot"] { max-width: none; white-space: nowrap; }
}
.copyright { margin-top: var(--sp-2); font-size: 0.74rem; color: var(--ink-3); letter-spacing: 0.01em; }
/* Gate dialog */
.gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(7, 22, 18, 0.76); backdrop-filter: blur(10px); }
.gate-card {
  width: 100%; max-width: 440px; background: #fbf9f4; border: 1.5px solid rgba(242, 184, 75, 0.45);
  border-radius: 24px; padding: var(--sp-8) 30px 26px;
  display: flex; flex-direction: column; gap: var(--sp-4); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.gate-badge {
  width: 60px; height: 60px; border-radius: 16px; background: var(--forest);
  border: 1px solid rgba(242, 184, 75, 0.45); display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(11, 38, 31, 0.25);
}
.gate-card h2 { font-size: 1.55rem; letter-spacing: -0.02em; }
.gate-card p { color: var(--ink-2); font-size: 0.9rem; }
#gate-input {
  font-family: var(--mono); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.04em; padding: 14px 16px;
  border-radius: 14px; border: 1.5px solid var(--line-gold); background: #fff; color: var(--ink); width: 100%;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82rem; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--forest-2); }
.link { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 0.84rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: center; }
.hint { color: var(--ink-3); font-size: 0.74rem; text-align: center; }
/* Sponsor hosting card */
.sponsor { margin: 34px 0 10px; background: var(--forest); border: 1.5px solid rgba(242, 184, 75, 0.55); border-radius: 24px; padding: 30px 28px 28px; text-align: center; color: #f4efe3; box-shadow: 0 18px 40px rgba(11, 38, 31, 0.2); }
.sponsor-icon { display: grid; place-items: center; }
.sponsor h2 { color: var(--gold); font-size: 1.5rem; letter-spacing: -0.01em; margin: 10px 0 8px; }
.sponsor p { color: #e9e0cb; font-size: 0.95rem; max-width: 560px; margin: 0 auto 6px; }
.sponsor .sponsor-line2 { color: var(--gold); font-weight: 700; margin-bottom: 18px; }
.sponsor-btn { min-width: 230px; }
.sponsor-mail { text-decoration: none; }
/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--sp-2); z-index: 80; max-width: calc(100vw - 32px); }
.toast { background: var(--forest); color: #f4efe3; border: 1px solid rgba(242, 184, 75, 0.4); padding: 10px 18px; border-radius: 999px; font-size: 0.84rem; font-weight: 600; white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); }
[dir='rtl'] .chip { text-align: right; }
/* Responsive — true narrow viewports, not zoom */
@media (max-width: 1024px) {
  .wrap { max-width: 960px; }
  .dispenser { padding: 28px 28px 24px; }
  .disp-kaaba-art { width: 280px; height: 244px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .bg-kaaba-scene { width: min(1000px, 135vw); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .top-in { gap: 10px; }
  .hero { padding: 18px 18px 20px; }
  .metrics-bar { grid-template-columns: 1fr; }
  .metric-card + .metric-card { border-inline-start: 0; border-top: 1px solid rgba(242, 184, 75, 0.22); }
  .metric-card { padding: 10px 14px; min-height: 58px; }
  .steps { grid-template-columns: 1fr; margin-bottom: 28px; }
  .dispenser { padding: 24px 22px 22px; border-radius: 22px; }
  .disp-kaaba-art { width: 240px; height: 210px; opacity: 0.65; }
  .disp-code { padding-inline-end: 80px; font-size: clamp(1.7rem, 7vw, 2.6rem); }
  .btn-cta kbd { display: none; }
  .seg button { padding: 6px 10px; }
  .guest-alert-in { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .top { padding-top: 16px; }
  .logo { font-size: 1rem; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .hero { padding: 16px; margin-bottom: 12px; }
  .hero h1 { font-size: 1.65rem; }
  .hero p { font-size: 0.92rem; }
  .dispenser { padding: 22px 18px 20px; }
  .disp-kaaba-art { width: 190px; height: 168px; opacity: 0.5; right: 0; top: 0; }
  .disp-code { padding-inline-end: 0; font-size: clamp(1.55rem, 8.5vw, 2.1rem); }
  .disp-actions { flex-direction: column; }
  .btn-ghost { padding: 13px 22px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .chip { font-size: 0.78rem; padding: 11px 10px; }
  .controls input { flex-basis: 100%; }
  #filters { width: 100%; overflow-x: auto; }
  .gate-card { padding: 26px 22px 22px; }
  .toast { white-space: normal; text-align: center; }
}
@media (max-width: 380px) {
  .wrap { padding: 0 14px; }
  .hero h1 { font-size: 1.45rem; }
  .grid { grid-template-columns: 1fr; }
  .chip { font-size: 0.82rem; }
  .disp-code { font-size: 1.45rem; letter-spacing: 0; }
  .btn-cta { font-size: 0.95rem; padding: 14px 16px; }
  .metric-val strong { font-size: 1.2rem; }
  .seg button { padding: 6px 8px; font-size: 0.74rem; }
  .foot { padding-bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
