/* === Round-Table runtime patch v2 (helpler.online) ===
   1) Hide the original "Выйти" button in bottom-nav on /game and /admin*
      so it can't be tapped/auto-triggered.
   2) Enlarge player name and "Мой баланс" in the in-game HUD.
   3) Style the dedicated /exit overlay screen.
================================================================== */

/* --- 1. Hide the original Exit button in bottom-nav --------------- */
body[data-rt-page="game"]  nav.fixed.bottom-0 > div > button,
body[data-rt-page="admin"] nav.fixed.bottom-0 > div > button {
  display: none !important;
}

/* Even spacing for remaining items + our injected "Выход" link. */
body[data-rt-page="game"]  nav.fixed.bottom-0 > div,
body[data-rt-page="admin"] nav.fixed.bottom-0 > div {
  justify-content: space-around !important;
}

/* --- 2. Bigger player name + balance in the game HUD ------------- */

/* Player name line: was text-sm (14px) → 18px. */
body[data-rt-page="game"]  .font-black.text-primary.text-sm.leading-tight,
body[data-rt-page="admin"] .font-black.text-primary.text-sm.leading-tight {
  font-size: 1.125rem !important;
  line-height: 1.25 !important;
}

/* "Мой баланс" value: was text-2xl (24px) → 32px. */
body[data-rt-page="game"] .text-2xl.font-black.tracking-tighter.text-foreground {
  font-size: 2rem !important;
  line-height: 1 !important;
}

/* "Мой баланс" / "Игрок" / "💰 Казна" labels (10px → 12px). */
body[data-rt-page="game"]  .text-\[10px\].text-muted-foreground.tracking-widest.uppercase,
body[data-rt-page="admin"] .text-\[10px\].text-muted-foreground.tracking-widest.uppercase {
  font-size: 12px !important;
}

/* --- 3. Dedicated /exit overlay screen --------------------------- */
#rt-exit-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f4f4f5;
  animation: rt-exit-fade 180ms ease-out;
}
@keyframes rt-exit-fade {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

#rt-exit-screen .rt-exit-card {
  width: 100%;
  max-width: 420px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 32px 24px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
}

#rt-exit-screen .rt-exit-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 14px;
}

#rt-exit-screen .rt-exit-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  color: #fafafa;
}

#rt-exit-screen .rt-exit-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #a1a1aa;
  margin: 0 0 24px;
}

#rt-exit-screen .rt-exit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#rt-exit-screen .rt-exit-btn {
  height: 48px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 100ms ease, background 120ms ease, border-color 120ms ease;
  font-family: inherit;
}
#rt-exit-screen .rt-exit-btn:active { transform: scale(0.97); }

#rt-exit-screen .rt-exit-btn--ghost {
  background: #27272a;
  color: #f4f4f5;
  border-color: rgba(255, 255, 255, 0.06);
}
#rt-exit-screen .rt-exit-btn--ghost:hover { background: #313136; }

#rt-exit-screen .rt-exit-btn--danger {
  background: #ef4444;
  color: #fff;
}
#rt-exit-screen .rt-exit-btn--danger:hover { background: #dc2626; }

#rt-exit-screen .rt-exit-hint {
  margin: 18px 0 0;
  font-size: 11px;
  color: #71717a;
  letter-spacing: 0.04em;
}

/* --- 4. Patch indicator (visible proof that JS loaded) ----------- */
#rt-patch-indicator {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.92);
  color: #fff;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
  pointer-events: none;
  transition: opacity 800ms ease;
}
#rt-patch-indicator.rt-fade-out { opacity: 0; }
