/* Pepinho Games — navigation overlay for the standalone game bundles (Frogger V2, Rocket V2, Snake V2, Balln/Game:33).
 * Site chrome, so it uses the light + blue system (docs/DESIGN_SYSTEM_CURRENT.md): white pills, navy text, blue border, yellow primary CTA,
 * Fredoka 600 titles, Inter body. The game canvases and in-game HUD keep their own look. */
@font-face { font-family: "PGN Fredoka"; font-weight: 600; font-style: normal; font-display: swap; src: url("/telegram/fonts/fredoka-600.woff2") format("woff2"); }
@font-face { font-family: "PGN Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/telegram/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "PGN Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/telegram/fonts/inter-400.woff2") format("woff2"); }

.pgn-root {
  --pgn-navy: #183b73; --pgn-blue: #397dd1; --pgn-yellow: #ffc83d; --pgn-text: #202b40; --pgn-border: #dce5f2;
  position: fixed; z-index: 2147483647;
  top: calc(env(safe-area-inset-top, 0px) + 8px); left: calc(env(safe-area-inset-left, 0px) + 8px);
  display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; max-width: calc(100vw - 16px);
  font-family: "PGN Inter", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  pointer-events: none; box-sizing: border-box;
}
.pgn-root[hidden], .pgn-chip[hidden] { display: none !important; }
.pgn-root * { box-sizing: border-box; }
.pgn-root > * { pointer-events: auto; }
.pgn-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 13px 0 10px; margin: 0;
  border-radius: 999px; border: 1px solid var(--pgn-blue); background: #fff; color: var(--pgn-navy);
  font: 600 13px/1 "PGN Inter", Inter, system-ui, sans-serif; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(24, 59, 115, .22); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pgn-chip:hover { background: #f1f6fd; }
.pgn-chip:focus-visible, .pgn-btn:focus-visible { outline: 2px solid var(--pgn-blue); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(255, 200, 61, .65); }
.pgn-chip svg { width: 14px; height: 14px; flex: none; }
.pgn-chip--menu { padding: 0 13px; }
@media (pointer: coarse) { .pgn-chip { min-height: 40px; } }
/* narrow screens: arrow + short label (the aria-label stays "Back to Games") */
.pgn-long { display: inline; } .pgn-short { display: none; }
@media (max-width: 520px), (orientation: landscape) and (max-height: 520px) { .pgn-long { display: none; } .pgn-short { display: inline; } }

/* mounted inside a game's own top bar (Frogger / Snake): flow layout, bar-sized */
.pgn-root--inline { position: static; flex: none; margin: 0 8px 0 0; max-width: none; z-index: auto; }
.pgn-root--inline .pgn-chip { min-height: 0; height: 26px; max-height: 100%; padding: 0 10px 0 7px; font-size: 12px; box-shadow: none; }
@media (pointer: coarse) { .pgn-root--inline .pgn-chip { height: 28px; } }

/* confirmation dialog */
.pgn-scrim {
  position: fixed; inset: 0; z-index: 2147483647; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) calc(env(safe-area-inset-right, 0px) + 12px) calc(env(safe-area-inset-bottom, 0px) + 12px) calc(env(safe-area-inset-left, 0px) + 12px);
  background: rgba(24, 59, 115, .52); font-family: "PGN Inter", Inter, system-ui, sans-serif; touch-action: none; box-sizing: border-box;
}
.pgn-scrim[hidden] { display: none !important; }
.pgn-scrim * { box-sizing: border-box; }
.pgn-card {
  width: 100%; max-width: 380px; max-height: 100%; overflow: auto; padding: 22px 20px 20px; border-radius: 16px; background: #fff;
  border: 1px solid #dce5f2; box-shadow: 0 12px 28px rgba(24, 59, 115, .22); color: #202b40; text-align: center;
}
.pgn-title { margin: 0 0 8px; font: 600 22px/1.2 "PGN Fredoka", "PGN Inter", system-ui, sans-serif; color: #183b73; }
.pgn-body { margin: 0 0 18px; font: 400 14px/1.45 "PGN Inter", Inter, system-ui, sans-serif; color: rgba(32, 43, 64, .78); }
.pgn-actions { display: flex; flex-direction: column; gap: 10px; }
.pgn-btn {
  min-height: 46px; padding: 0 18px; border-radius: 999px; font: 600 15px/1 "PGN Inter", Inter, system-ui, sans-serif; cursor: pointer;
  border: 1px solid #397dd1; background: #fff; color: #183b73; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pgn-btn--primary { background: #ffc83d; border-color: rgba(246, 205, 90, .55); color: #183b73; box-shadow: 0 0 18px rgba(229, 170, 27, .3); }
.pgn-btn:hover { filter: brightness(.97); }
@media (min-width: 420px) and (max-height: 520px) { .pgn-actions { flex-direction: row-reverse; } .pgn-actions .pgn-btn { flex: 1; } }

/* Rocket: its own top-left HUD (pause + settings buttons) and the platform bar fill the top edge, so the chip sits bottom-left, above the spike strip */
.pgn-root[data-pgn-game="rocket"] {
  top: auto; left: calc(env(safe-area-inset-left, 0px) + 6px); bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
}

/* Balln: the floating chip only shows while Balln loads / failed (see game-nav.js); the way back during play is an entry inside Balln's own Options panel
 * (dark panel, so this one is a translucent light-on-dark button, 44px tall for touch). Balln's own main-menu home pill stays visible. */
.pgn-inmenu { display: block; width: 100%; margin: 10px 0 0; font-family: "PGN Inter", Inter, system-ui, -apple-system, "Segoe UI", sans-serif; box-sizing: border-box; }
.pgn-inmenu * { box-sizing: border-box; }
.pgn-inmenu__link {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; cursor: pointer;
  font: 600 14px/1.2 "PGN Inter", Inter, system-ui, sans-serif; letter-spacing: .01em; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pgn-inmenu__link:hover { background: rgba(255, 255, 255, .2); }
.pgn-inmenu__link:focus-visible { outline: 2px solid #ffc83d; outline-offset: 2px; }
.pgn-inmenu__link svg { width: 14px; height: 14px; flex: none; }
