/* «صيد اللقطات»: the mini-game played while a video downloads (js/game.js).
   Every selector starts with .game- ; colours come from the theme tokens in app.css. */

.game-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 240px;
  overflow: hidden;
  border-radius: inherit;
  background: var(--bg-2, #f2f2f6);
  color: var(--text, #121214);
  font-family: var(--font, sans-serif);
  line-height: 1.4;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* the drag moves the camera, never the page */
}

/* red wash over the field when a bad one is caught: js animates the opacity */
.game-flash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent, #e3141b);
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ score and lives */

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  pointer-events: none;
}
.game-ready .game-hud { visibility: hidden; }
.game-score-box { display: flex; align-items: center; gap: 8px; }
.game-score {
  min-width: 1ch;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.game-combo {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent, #e3141b);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.3s var(--ease-pop, ease-out);
}
.game-combo-on { opacity: 1; transform: none; }
.game-lives { display: flex; gap: 4px; direction: ltr; }
.game-life {
  color: var(--accent, #e3141b);
  font-size: 18px;
  line-height: 1;
  transition: opacity 0.2s, transform 0.3s var(--ease-out, ease-out);
}
.game-life-off { opacity: 0.22; transform: scale(0.8); }

/* ------------------------------------------------------------------ start and game-over card */

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.game-overlay[hidden] { display: none; }
.game-ready .game-overlay { cursor: pointer; }
.game-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  padding: 20px 18px 18px;
  border-radius: 18px;
  background: var(--card, #ffffff);
  box-shadow: var(--shadow-md, 0 4px 18px rgba(0, 0, 0, 0.16));
  text-align: center;
  animation: game-in 0.3s var(--ease-out, ease-out) both;
}
.game-title { font-size: 20px; font-weight: 700; }
.game-text { font-size: 14px; line-height: 1.6; color: var(--text-2, #6b6b73); }
.game-stats { display: flex; justify-content: center; gap: 28px; }
.game-stats:empty { display: none; }
.game-stat { display: flex; flex-direction: column; align-items: center; }
.game-stat-num { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.game-stat-label { font-size: 13px; color: var(--text-2, #6b6b73); }
.game-btn {
  height: 48px;
  margin-top: 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent, #e3141b);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.3s var(--ease-out, ease-out), background-color 0.2s;
}
.game-btn:active { transform: scale(0.97); background: var(--accent-press, #c20f15); transition-duration: 0.08s; }
.game-ready .game-btn { animation: game-pulse 1.6s ease-in-out infinite; }

@keyframes game-in {
  from { opacity: 0; transform: scale(0.94); }
}
@keyframes game-pulse {
  50% { transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .game-panel, .game-ready .game-btn { animation: none; }
  .game-combo, .game-life, .game-btn { transition: none; }
}
