/* Host gier-nagród: nakładka pełnoekranowa */
body.mg-open { overflow: hidden; }
.mg-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: #10162b;
  color: #fff;
  font-family: var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.mg-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}
.mg-title { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; }
.mg-icon { font-size: 22px; }
.mg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-lvl { font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, 0.12); padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.mg-status { flex: 1; font-size: 13px; opacity: 0.85; text-align: center; min-width: 60px; }
.mg-score { font-weight: 900; font-size: 18px; }
.mg-timer { display: flex; align-items: center; gap: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mg-timebar { width: 90px; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.mg-timebar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd43b, #51cf66); border-radius: 99px; transition: width 0.25s linear; }
.mg-hurry .mg-timebar i { background: #ff6b6b; }
.mg-hurry .mg-time-txt { color: #ff8787; animation: mgPulse 0.5s infinite alternate; }
@keyframes mgPulse { to { transform: scale(1.15); } }
.mg-iconbtn { border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; width: 38px; height: 38px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.mg-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.mg-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 30, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 5;
  padding: 16px;
  overflow-y: auto;
}
.mg-card {
  background: var(--panel);
  color: var(--ink);
  border-radius: 24px;
  padding: 22px 22px 18px;
  width: min(520px, 100%);
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
  box-shadow: var(--shadow);
  animation: mgIn 0.25s ease-out;
}
.mg-card-sm { width: min(340px, 100%); display: flex; flex-direction: column; gap: 10px; }
@keyframes mgIn { from { transform: scale(0.9); opacity: 0; } }
.mg-card h2 { margin: 4px 0 6px; font-size: 26px; }
.mg-card p { margin: 6px 0; color: var(--muted); line-height: 1.35; }
.mg-reason { font-weight: 900; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; min-height: 18px; }
.mg-bigicon { font-size: 64px; line-height: 1.1; animation: mgBob 1.6s ease-in-out infinite; }
@keyframes mgBob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.mg-controls { font-size: 14px; }
.mg-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.mg-meta span { background: var(--chip); padding: 6px 10px; border-radius: 12px; font-size: 14px; }
.mg-shopbox { text-align: left; background: var(--bg); border-radius: 16px; padding: 10px; margin: 10px 0 14px; }
.mg-shophead { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 6px; }
.mg-shop { display: flex; flex-direction: column; gap: 6px; }
.mg-item { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 12px; padding: 8px; }
.mg-item-ic { font-size: 28px; width: 36px; text-align: center; }
.mg-item-tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mg-item-tx small { color: var(--muted); font-size: 12px; }
.mg-item-tx .mg-have { color: var(--accent); font-weight: 700; }
.mg-buy { border: 0; border-radius: 10px; padding: 8px 10px; font-weight: 800; background: var(--gold); color: #3a2a00; cursor: pointer; white-space: nowrap; font-family: inherit; }
.mg-buy:disabled { opacity: 0.45; cursor: not-allowed; }
.mg-stars { font-size: 44px; letter-spacing: 6px; color: #d0d4dc; }
.mg-stars .on { color: var(--gold); text-shadow: 0 2px 0 var(--gold-d); }
.mg-newbest { color: var(--good) !important; font-weight: 800; }
.mg-flash {
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  background: var(--gold);
  color: #3a2a00;
  font-weight: 900;
  padding: 10px 18px;
  border-radius: 99px;
  z-index: 10;
  animation: mgIn 0.2s ease-out;
  pointer-events: none;
}
/* Przyciski dotykowe wspólne dla gier (opcjonalne): .mg-touch > button */
.mg-touch { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: space-between; padding: 0 12px; pointer-events: none; z-index: 3; }
.mg-touch .grp { display: flex; gap: 10px; pointer-events: auto; }
.mg-touch button {
  width: 64px; height: 64px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 26px; font-weight: 900;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.mg-touch button.on { background: rgba(255, 255, 255, 0.4); }
@media (max-width: 560px) {
  .mg-timebar { width: 56px; }
  .mg-name { max-width: 120px; }
  .mg-status { order: 9; flex-basis: 100%; }
}
