/* "Spot the polyps" — ported from GetScreened/Views/Game.
   A full-viewport first-person colonoscopy with HTML overlays on a WebGL
   canvas. */

.game-root {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.game-canvas { position: absolute; inset: 0; }
.game-canvas canvas { display: block; width: 100%; height: 100%; }

.game-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center;
  padding: calc(var(--safe-top) + 6px) 8px 8px;
}
.game-topbar .navbar-back { color: var(--secondary); }
.game-topbar .navbar-back svg { transform: scaleX(-1); }
html[dir="rtl"] .game-topbar .navbar-back svg { transform: none; }
.game-topbar .title { flex: 1; text-align: center; font-weight: 600; color: var(--ink); }
.game-topbar .spacer { width: 56px; }

.vignette { position: absolute; inset: 0; z-index: 5; pointer-events: none; transition: background var(--gentle); }

.hud { position: absolute; top: calc(var(--safe-top) + 50px); left: 0; right: 0; z-index: 15; pointer-events: none; }
.hud-row { display: flex; align-items: center; justify-content: space-between; padding: 6px var(--screen-padding) 0; }
.hud-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.94rem; font-weight: 700; color: var(--secondary);
  padding: 8px 14px; border-radius: 999px; background: var(--card);
}
.hud-pill svg { width: 16px; height: 16px; }
.hud-pause {
  pointer-events: auto;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  display: grid; place-items: center; background: var(--card); color: var(--ink); cursor: pointer;
}
.hud-pause svg { width: 18px; height: 18px; }

.careful-badge {
  position: absolute; top: calc(var(--safe-top) + 104px); left: 0; right: 0; z-index: 15;
  display: flex; justify-content: center; pointer-events: none;
}
.careful-badge .inner {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem; font-weight: 600; color: var(--secondary);
  padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,0.94);
}
.careful-badge svg { width: 15px; height: 15px; }

.controls-hint {
  position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-bottom)); z-index: 15;
  display: flex; justify-content: center; pointer-events: none;
}
.controls-hint .inner {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem; font-weight: 500; color: var(--ink);
  padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,0.94);
}
.controls-hint svg { width: 15px; height: 15px; }

.game-toast {
  position: absolute; left: 40px; right: 40px; bottom: calc(64px + var(--safe-bottom)); z-index: 16;
  display: flex; justify-content: center; pointer-events: none;
}
.game-toast .inner {
  font-size: 0.84rem; font-weight: 500; color: var(--ink); text-align: center;
  padding: 10px 16px; border-radius: 12px; background: rgba(255,255,255,0.96);
}

.snare {
  position: absolute; z-index: 14; pointer-events: none;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
}
.snare .ring { position: absolute; border: 3px solid var(--secondary); border-radius: 50%;
  animation: snare-close 0.42s ease-out forwards; }
@keyframes snare-close {
  from { transform: scale(1.45); opacity: 0.9; }
  to { transform: scale(0.55); opacity: 0; }
}
.snare .check { color: var(--secondary); background: var(--canvas); border-radius: 50%;
  width: 26px; height: 26px; display: grid; place-items: center;
  animation: snare-pop 0.42s ease-out forwards; }
@keyframes snare-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ripple {
  position: absolute; z-index: 14; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid rgba(251,247,238,0.7); transform: translate(-50%, -50%);
  pointer-events: none; animation: fade-out 0.4s ease-out forwards;
}
@keyframes fade-out { from { opacity: 0.8; } to { opacity: 0; } }

.game-overlay {
  position: absolute; inset: 0; z-index: 18;
  display: flex; align-items: center; justify-content: center;
  background: rgba(33,29,22,0.18); padding: var(--screen-padding);
  animation: fade-in var(--gentle) both;
}
.game-overlay .overlay-card {
  width: 100%; max-width: var(--content-max);
  background: var(--card); border-radius: var(--corner);
  padding: 22px; box-shadow: 0 14px 36px rgba(33,29,22,0.22);
  display: flex; flex-direction: column; gap: 14px;
  max-height: 86vh; overflow-y: auto;
}
.overlay-card .cover { width: 100%; height: 130px; object-fit: cover; border-radius: 12px; }
.intro-row { display: flex; align-items: flex-start; gap: 10px; }
.intro-row .ico { flex: none; width: 20px; color: var(--accent-deep); display: grid; place-items: center; margin-top: 2px; }
.intro-row .ico svg { width: 15px; height: 15px; }
.intro-row .tx { font-size: 0.94rem; color: var(--ink); }
.field-guide { display: flex; gap: 10px; }
.field-guide .fg { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.field-guide .fg img { height: 34px; }
.field-guide .fg span { font-size: 0.72rem; font-weight: 500; color: var(--ink-soft); }

.exam-map { display: flex; flex-direction: column; gap: 8px; }
.exam-map .track { position: relative; height: 18px; }
.exam-map .rail { position: absolute; top: 4px; left: 0; right: 0; height: 10px; border-radius: 999px; background: var(--wash); }
.exam-map .dot { position: absolute; top: 2px; width: 13px; height: 13px; border-radius: 50%; transform: translateX(-50%); }
.exam-map .legend { display: flex; gap: 16px; }
.exam-map .legend .lg { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--ink-soft); }
.exam-map .legend .lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
