/* Gizli oyun "Topu Getir": tam ekran katman, üst bilgi, ipucu ve sonuç kartı */
html.game-open, html.game-open body { overflow: hidden; }
/* Oyun açıkken arkadaki sahne boşuna çalışmasın */
html.game-open .page, html.game-open .page *, html.game-open .trail * { animation-play-state: paused !important; }

.fetch-game {
  position: fixed; inset: 0; z-index: 100;
  background: #FBF7F0; color: #2c1e14;
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  opacity: 0; transition: opacity .35s ease;
  overscroll-behavior: contain;
}
.fetch-game[hidden] { display: none; }
.fetch-game.show { opacity: 1; }

.fg-stage {
  position: absolute; inset: 0; outline: none; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.fg-canvas { display: block; width: 100%; height: 100%; }

/* ---------- Üst bilgi ---------- */
.fg-hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.fg-title {
  margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: 32px; line-height: 1; letter-spacing: -.01em; color: #2c1e14;
  transition: color .6s;
}
.fg-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.fg-stat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.74); color: #7a3f1d;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(60,40,25,.08);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background .6s, color .6s;
}
.fg-stat svg { width: 16px; height: 16px; }
.fg-close {
  margin-left: auto; pointer-events: auto; flex: none;
  width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.8); color: #8a4a24;
  box-shadow: 0 4px 14px rgba(60,40,25,.10);
  transition: background .2s, color .2s, transform .2s;
}
.fg-close svg { width: 20px; height: 20px; }
.fg-close:hover { background: #8a4a24; color: #fff; transform: rotate(90deg); }
.fg-close:focus-visible, .fg-btn:focus-visible { outline: 2px solid #8a4a24; outline-offset: 3px; }

/* ---------- İpucu ---------- */
.fg-hint {
  position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%); margin: 0; max-width: calc(100% - 32px);
  padding: 9px 16px; border-radius: 999px;
  background: rgba(44,30,20,.74); color: #FBF7F0;
  font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; transition: opacity .4s, transform .4s;
}
.fg-hint.off { opacity: 0; transform: translate(-50%, 8px); }

/* ---------- Sonuç kartı ---------- */
.fg-over {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: rgba(30,26,43,.28);
}
.fg-over[hidden] { display: none; }
.fg-card {
  width: 100%; max-width: 340px; padding: 26px 26px 22px; border-radius: 22px;
  background: #FBF7F0; text-align: center;
  box-shadow: 0 24px 60px rgba(30,20,10,.28);
  animation: pop .5s cubic-bezier(.34,1.56,.64,1) both;
}
.fg-cause { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-size: 32px; line-height: 1.1; color: #2c1e14; }
.fg-result { margin: 10px 0 0; font-size: 17px; font-weight: 600; color: #8a4a24; }
.fg-record { margin: 4px 0 0; font-size: 14px; color: rgba(60,40,25,.6); }
.fg-record.is-record { color: #B0643A; font-weight: 700; }
.fg-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.fg-btn {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 11px 18px; border-radius: 999px; border: 1.5px solid rgba(138,74,36,.25);
  background: transparent; color: #8a4a24; transition: background .2s, color .2s, transform .15s;
}
.fg-btn:hover { background: rgba(138,74,36,.08); }
.fg-btn:active { transform: scale(.97); }
.fg-btn.primary { background: #8a4a24; border-color: #8a4a24; color: #fff; box-shadow: 0 6px 18px rgba(138,74,36,.28); }
.fg-btn.primary:hover { background: #7a3f1d; }

/* ---------- Gece: üst bilgi renkleri ---------- */
.fetch-game.is-night .fg-title { color: #F7EDDE; }
.fetch-game.is-night .fg-stat { background: rgba(40,34,58,.72); color: #F0CB95; }
.fetch-game.is-night .fg-close { background: rgba(40,34,58,.72); color: #F0CB95; }
.fetch-game.is-night .fg-close:hover { background: #F0CB95; color: #1E1A2B; }
.fetch-game.is-night .fg-hint { background: rgba(247,237,222,.14); color: #F7EDDE; }

/* ---------- Dar ekran ---------- */
@media (max-width: 600px) {
  .fg-hud { gap: 10px; }
  .fg-title { font-size: 25px; }
  .fg-stat { padding: 5px 10px; font-size: 13px; }
  .fg-best { display: none; }
  .fg-hint { font-size: 13px; }
}
@media (max-width: 360px) {
  .fg-title { display: none; }
}
