@font-face {
  font-family: 'CairoX';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('vendor/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'CairoX';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('vendor/fonts/cairo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212;
}
@font-face {
  font-family: 'CairoX';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('vendor/fonts/cairo-arabic-bold.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --deep: #050d10;
  --gold: #ffd166;
  --gold-2: #e0a92f;
  --cyan: #7df6ff;
  --ink: #f3f7f4;
  --muted: #9fb8ae;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--deep);
  color: var(--ink);
  font-family: 'CairoX', 'Noto Sans Arabic', 'Noto Naskh Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation;
}

#world, #overlay {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
}
#overlay { pointer-events: none; }
#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 45%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
}
#cam { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0.001; pointer-events: none; }
.hidden { display: none !important; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 18px; }
.hud-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pill {
  background: rgba(5, 18, 22, 0.55);
  border: 1px solid rgba(255, 209, 102, 0.32);
  border-radius: 999px;
  padding: 7px 18px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pill.score { font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1.1; min-width: 76px; text-align: center; }
.pill.best { font-size: 15px; color: var(--muted); line-height: 1.5; }
.pill.best span { color: var(--ink); font-weight: 700; }
.chip {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 70px);
  background: rgba(5, 18, 22, 0.62);
  border: 1px solid rgba(255, 209, 102, 0.24);
  color: var(--ink); font-size: 17px; font-weight: 700;
  padding: 8px 20px; border-radius: 999px; white-space: nowrap;
}
.chip.off { color: var(--muted); border-color: rgba(255, 255, 255, 0.14); }
.chip.warn { color: var(--gold); }
.hint {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 118px);
  white-space: nowrap;
  color: var(--gold); font-size: 17px; font-weight: 700;
  background: rgba(5, 18, 22, 0.6); border: 1px solid rgba(255, 209, 102, 0.28);
  padding: 8px 18px; border-radius: 999px;
  animation: pulseHint 2.4s ease-in-out infinite;
}
@keyframes pulseHint { 0%,100% { opacity: 0.65; } 50% { opacity: 1; } }

/* screens */
.screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: radial-gradient(120% 90% at 50% 0%, #12303a 0%, #050d10 72%);
  overflow-y: auto;
}
.card {
  width: 100%; max-width: 430px;
  background: linear-gradient(180deg, rgba(16, 48, 56, 0.95), rgba(6, 20, 24, 0.98));
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 26px;
  padding: 24px 22px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.card.center { text-align: center; }
.logo { font-size: 44px; line-height: 1; text-align: center; margin-bottom: 8px; }
h1 { font-size: 31px; margin: 0 0 8px; text-align: center; color: var(--gold); font-weight: 700; }
h2 { font-size: 24px; margin: 0 0 10px; text-align: center; }
.lead { margin: 0 0 14px; color: var(--muted); font-size: 17px; line-height: 1.6; text-align: center; }
.rules { list-style: none; margin: 0 0 14px; padding: 0; }
.rules li { font-size: 16.5px; line-height: 1.5; padding: 6px 0; color: #dcece2; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.rules li:last-child { border-bottom: 0; }
.rules b { color: var(--gold); font-weight: 700; }
.rules .ico { display: inline-block; width: 1.7em; text-align: center; margin-inline-end: 4px; }
.privacy {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(125, 246, 255, 0.07);
  border: 1px solid rgba(125, 246, 255, 0.22);
  border-radius: 16px; padding: 11px 13px; margin: 0 0 16px;
  font-size: 15px; line-height: 1.6; color: #e7f2ea;
}
.privacy .lock { font-size: 18px; line-height: 1.4; }
.btn {
  display: block; width: 100%; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: #22180a; font-family: inherit; font-size: 21px; font-weight: 700;
  padding: 15px 20px; border-radius: 18px;
  box-shadow: 0 10px 24px rgba(224, 169, 47, 0.26);
}
.btn:active { transform: translateY(1px); }
.tiny { margin: 11px 0 0; font-size: 13.5px; color: #8fae9d; text-align: center; line-height: 1.5; }
.spinner {
  width: 52px; height: 52px; margin: 6px auto 16px;
  border: 5px solid rgba(255, 209, 102, 0.2); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-height: 660px) {
  .card { padding: 18px 18px 18px; border-radius: 20px; }
  h1 { font-size: 26px; }
  .logo { font-size: 34px; }
  .rules li { font-size: 15px; padding: 5px 0; }
  .lead { font-size: 15.5px; margin-bottom: 11px; }
  .btn { font-size: 19px; padding: 13px; }
}

.chip.hot {
  color: #eafcff;
  border-color: rgba(125, 246, 255, 0.55);
  background: rgba(10, 42, 54, 0.8);
  box-shadow: 0 0 18px rgba(125, 246, 255, 0.25);
}
