/* ===== HOLO-WATCH AR ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --cyan: #22e6ff;
  --cyan-dim: rgba(34, 230, 255, .35);
  --orange: #ff7a1a;
  --bg: #05090f;
  --panel: rgba(8, 16, 24, .82);
  --line: rgba(34, 230, 255, .25);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", sans-serif;
  color: #dff8ff;
  touch-action: none;
}

/* ===== طبقات العرض ===== */
#cam, #gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}
#cam { z-index: 1; background: #000; }
#cam.mirrored { transform: scaleX(-1); }
#gl  { z-index: 2; pointer-events: none; }

.scanlines {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .12;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.55) 2px 4px);
  mix-blend-mode: multiply;
}
.vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 8, 14, .6) 100%);
}

/* ===== الشريط العلوي ===== */
#hud-top {
  position: fixed; top: 0; right: 0; left: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(to bottom, rgba(3, 8, 14, .85), transparent);
}
.brand {
  font-size: 15px; font-weight: 800; letter-spacing: 2px;
  color: #eafcff; display: flex; align-items: center; gap: 8px;
  text-shadow: 0 0 12px var(--cyan-dim);
}
.brand em { font-style: normal; color: var(--orange); }
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a7180; }
.status-track .status-dot { background: #2effa1; box-shadow: 0 0 9px #2effa1; }
.status-palm  .status-dot { background: var(--orange); box-shadow: 0 0 9px var(--orange); }
.status-idle  .status-dot { background: #ff5470; box-shadow: 0 0 9px #ff5470; }

/* ===== أزرار التحكم ===== */
#hud-bottom {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 12px 16px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(3, 8, 14, .9), transparent);
}
.hint {
  font-size: 13px; color: #bfeffb; text-align: center;
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px; backdrop-filter: blur(6px);
  max-width: 92vw;
}
.hint b { color: var(--cyan); }
.controls { display: flex; gap: 14px; }
.ctl {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 74px; padding: 10px 0 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  color: var(--cyan); font-size: 11px; font-family: inherit;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: transform .12s, box-shadow .12s, color .12s;
}
.ctl:active { transform: scale(.93); }
.ctl.active { box-shadow: 0 0 14px var(--cyan-dim), inset 0 0 12px rgba(34,230,255,.12); }
.ctl.off { color: #5a7180; box-shadow: none; }

/* ===== شاشة البداية ===== */
#intro {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #0a1622 0%, #04070c 70%);
  padding: 20px;
  transition: opacity .5s;
}
#intro.fade { opacity: 0; pointer-events: none; }
.intro-card {
  position: relative; width: min(420px, 94vw);
  background: rgba(9, 18, 28, .9);
  border: 1px solid var(--line); border-radius: 24px;
  padding: 26px 26px 22px; text-align: center;
  box-shadow: 0 0 60px rgba(34, 230, 255, .08), inset 0 0 40px rgba(34, 230, 255, .04);
  overflow: hidden;
}
.intro-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 160px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(34,230,255,.18), transparent 70%);
  pointer-events: none;
}
.intro-img {
  width: 128px; height: 128px; object-fit: cover; border-radius: 50%;
  border: 2px solid var(--cyan); box-shadow: 0 0 24px var(--cyan-dim);
  margin-bottom: 14px;
}
.intro-card h1 { font-size: 24px; letter-spacing: .5px; color: #eafcff; }
.intro-card h1 span { color: var(--orange); }
.intro-card .sub { font-size: 13px; color: #8fd8ea; margin: 6px 0 16px; }
.steps {
  list-style: none; text-align: right; margin: 0 auto 18px;
  display: flex; flex-direction: column; gap: 8px; max-width: 300px;
}
.steps li {
  font-size: 13px; color: #c9ecf6;
  background: rgba(34, 230, 255, .06);
  border: 1px solid rgba(34, 230, 255, .15);
  border-radius: 12px; padding: 8px 12px;
}
.steps li b { color: var(--cyan); margin-left: 4px; }
.steps li b:first-child {
  display: inline-block; width: 20px; height: 20px; line-height: 20px;
  text-align: center; border-radius: 50%;
  background: rgba(34, 230, 255, .15); border: 1px solid var(--line);
}
#btn-start {
  width: 100%; padding: 15px; font-size: 16px; font-weight: 700; font-family: inherit;
  color: #02131a; background: linear-gradient(135deg, var(--cyan), #4df0c8);
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 0 26px rgba(34, 230, 255, .45);
  transition: transform .12s, box-shadow .2s;
}
#btn-start:active { transform: scale(.96); }
#btn-start:disabled { opacity: .5; box-shadow: none; cursor: wait; }
.note { font-size: 11px; color: #6c93a3; margin-top: 12px; line-height: 1.7; }
.err {
  font-size: 12px; color: #ff9db1; margin-top: 10px; line-height: 1.7;
  background: rgba(255, 84, 112, .08); border: 1px solid rgba(255, 84, 112, .3);
  border-radius: 10px; padding: 8px 10px;
}

.hidden { display: none !important; }
